On Sun, Jun 28, 2020 at 12:41 AM Carl Eugen Hoyos <ceffm...@gmail.com> wrote: > > Am Sa., 27. Juni 2020 um 20:11 Uhr schrieb <gautamr...@gmail.com>: > > > +static int ff_pgx_decode_header(AVCodecContext *avctx, PGXContext * s, > > + int *depth, int *width, int *height, > > + int *sign) > > +{ > > + const char *header_start = "PG ML "; > > + int byte; > > + > > + if (bytestream2_get_bytes_left(&s->g) < 13) { > > + return AVERROR_INVALIDDATA; > > + } > > Do other decoders do this for 13 bytes or less? This could be improved. I modify it. > > > + // Checks whether file starts with "PG ML " > > + if (memcmp(header_start, s->g.buffer, 6)) > > + return AVERROR_INVALIDDATA; > > If you really have to keep this why isn't it: > memcmp("PG ML ", s->g.buffer, 6) > which would make the ugly comment go away? I shall change this. I do not understand how the check can be removed. It is compulsory that a PGX file must have these bytes
-- ------------- Gautam | _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".