On Thu, Jun 16, 2016 at 11:26:02AM +0200, Clément Bœsch wrote: > From: Clément Bœsch <clem...@stupeflix.com> > > --- > Still unsure about the FATE changes. > Also couldn't test pgm vs pgmyuv due to a crash > --- > libavformat/Makefile | 5 +++++ > libavformat/allformats.c | 5 +++++ > libavformat/img2dec.c | 55 > +++++++++++++++++++++++++++++++++++++++++++++ > tests/ref/seek/lavf-pbmpipe | 50 ++++++++++++++++++++++------------------- > tests/ref/seek/lavf-pgmpipe | 50 ++++++++++++++++++++++------------------- > tests/ref/seek/lavf-ppmpipe | 50 ++++++++++++++++++++++------------------- > 6 files changed, 146 insertions(+), 69 deletions(-) > > diff --git a/libavformat/Makefile b/libavformat/Makefile > index 481f3b1..12d8f6b 100644 > --- a/libavformat/Makefile > +++ b/libavformat/Makefile > @@ -226,9 +226,14 @@ OBJS-$(CONFIG_IMAGE_EXR_PIPE_DEMUXER) += img2dec.o > img2.o > OBJS-$(CONFIG_IMAGE_J2K_PIPE_DEMUXER) += img2dec.o img2.o > OBJS-$(CONFIG_IMAGE_JPEG_PIPE_DEMUXER) += img2dec.o img2.o > OBJS-$(CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER) += img2dec.o img2.o > +OBJS-$(CONFIG_IMAGE_PAM_PIPE_DEMUXER) += img2dec.o img2.o > +OBJS-$(CONFIG_IMAGE_PBM_PIPE_DEMUXER) += img2dec.o img2.o > OBJS-$(CONFIG_IMAGE_PCX_PIPE_DEMUXER) += img2dec.o img2.o > +OBJS-$(CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER) += img2dec.o img2.o > +OBJS-$(CONFIG_IMAGE_PGM_PIPE_DEMUXER) += img2dec.o img2.o > OBJS-$(CONFIG_IMAGE_PICTOR_PIPE_DEMUXER) += img2dec.o img2.o > OBJS-$(CONFIG_IMAGE_PNG_PIPE_DEMUXER) += img2dec.o img2.o > +OBJS-$(CONFIG_IMAGE_PPM_PIPE_DEMUXER) += img2dec.o img2.o > OBJS-$(CONFIG_IMAGE_QDRAW_PIPE_DEMUXER) += img2dec.o img2.o > OBJS-$(CONFIG_IMAGE_SGI_PIPE_DEMUXER) += img2dec.o img2.o > OBJS-$(CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER) += img2dec.o img2.o > diff --git a/libavformat/allformats.c b/libavformat/allformats.c > index ddf540c..d490cc4 100644 > --- a/libavformat/allformats.c > +++ b/libavformat/allformats.c > @@ -356,9 +356,14 @@ void av_register_all(void) > REGISTER_DEMUXER (IMAGE_J2K_PIPE, image_j2k_pipe); > REGISTER_DEMUXER (IMAGE_JPEG_PIPE, image_jpeg_pipe); > REGISTER_DEMUXER (IMAGE_JPEGLS_PIPE, image_jpegls_pipe); > + REGISTER_DEMUXER (IMAGE_PAM_PIPE, image_pam_pipe); > + REGISTER_DEMUXER (IMAGE_PBM_PIPE, image_pbm_pipe); > REGISTER_DEMUXER (IMAGE_PCX_PIPE, image_pcx_pipe); > + REGISTER_DEMUXER (IMAGE_PGMYUV_PIPE, image_pgmyuv_pipe); > + REGISTER_DEMUXER (IMAGE_PGM_PIPE, image_pgm_pipe); > REGISTER_DEMUXER (IMAGE_PICTOR_PIPE, image_pictor_pipe); > REGISTER_DEMUXER (IMAGE_PNG_PIPE, image_png_pipe); > + REGISTER_DEMUXER (IMAGE_PPM_PIPE, image_ppm_pipe); > REGISTER_DEMUXER (IMAGE_QDRAW_PIPE, image_qdraw_pipe); > REGISTER_DEMUXER (IMAGE_SGI_PIPE, image_sgi_pipe); > REGISTER_DEMUXER (IMAGE_SUNRAST_PIPE, image_sunrast_pipe); > diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c > index 1b0e608..9cbc9dc 100644 > --- a/libavformat/img2dec.c > +++ b/libavformat/img2dec.c > @@ -862,6 +862,56 @@ static int webp_probe(AVProbeData *p) > return 0; > } > > +static int pnm_magic_check(const AVProbeData *p, int magic) > +{ > + const uint8_t *b = p->buf; > + > + return b[0] == 'P' && b[1] == magic + '0'; > +} > + > +static inline int pnm_probe(const AVProbeData *p) > +{ > + const uint8_t *b = p->buf; > + > + while (b[2] == '\r') > + b++;
shouldnt this check buf_size ? either way patch LGTM [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Modern terrorism, a quick summary: Need oil, start war with country that has oil, kill hundread thousand in war. Let country fall into chaos, be surprised about raise of fundamantalists. Drop more bombs, kill more people, be surprised about them taking revenge and drop even more bombs and strip your own citizens of their rights and freedoms. to be continued
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel