[FFmpeg-devel] [PATCH 2/2] avformat/img2dec: add GEM Raster image demuxer

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Jan 23 02:01:58 EET 2022


Am Fr., 17. Sept. 2021 um 10:39 Uhr schrieb Peter Ross <pross at xvid.org>:

> +static int gem_probe(const AVProbeData *p)
> +{
> +    const uint8_t *b = p->buf;
> +    int ret = 0;
> +    if ( AV_RB16(b     ) >= 1 && AV_RB16(b    ) <= 3  &&
> +         AV_RB16(b +  2) >= 8 && AV_RB16(b + 2) <= 779 &&
> +        (AV_RB16(b +  4) > 0  || AV_RB16(b + 4) <= 8) &&
> +        (AV_RB16(b +  6) > 0  || AV_RB16(b + 6) <= 8) &&
> +         AV_RB16(b +  8) &&
> +         AV_RB16(b + 10) &&
> +         AV_RB16(b + 12) &&
> +         AV_RB16(b + 14)) {
> +        ret = AVPROBE_SCORE_EXTENSION / 4;

Without running probetest, this score looks too high to me.
(1, 2 or 3 followed by anything not 0 with some restrictions?)

Why is the above sufficient? Are there files in the wild
without the fourcc's below?

> +        if (AV_RN32(b + 16) == AV_RN32("STTT") ||
> +            AV_RN32(b + 16) == AV_RN32("TIMG") ||
> +            AV_RN32(b + 16) == AV_RN32("XIMG"))
> +            ret += 1;

Should be EXTENSION + 1

Carl Eugen


More information about the ffmpeg-devel mailing list