On Sun, Jan 23, 2022 at 01:01:58AM +0100, Carl Eugen Hoyos wrote: > Am Fr., 17. Sept. 2021 um 10:39 Uhr schrieb Peter Ross : > > > +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?) The probetest warning is only triggered when the score is greater than AVPROBE_SCORE_EXTENSION / 4 This score is consistent with other image2 demuxers like bmp and pcx. How much lower does it need to be? > Why is the above sufficient? Are there files in the wild > without the fourcc's below? Correct, not all files have 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 Agree. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)