[FFmpeg-devel] [PATCH v2 1/2] libavcodec/pgxdec: Add PGX decoder

Carl Eugen Hoyos ceffmpeg at gmail.com
Sat Jun 27 22:11:22 EEST 2020


Am Sa., 27. Juni 2020 um 20:11 Uhr schrieb <gautamramk at 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?

> +    // 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?

Carl Eugen


More information about the ffmpeg-devel mailing list