Commit dee79438 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

lavf/img2dec: Improve detection of valid Quickdraw images.

Detect Quickdraw images without application header with
lower score.
parent 5a458420
...@@ -725,9 +725,15 @@ static int qdraw_probe(AVProbeData *p) ...@@ -725,9 +725,15 @@ static int qdraw_probe(AVProbeData *p)
{ {
const uint8_t *b = p->buf; const uint8_t *b = p->buf;
if (!b[10] && AV_RB32(b+11) == 0x1102ff0c && !b[15] || if ( p->buf_size >= 528
p->buf_size >= 528 && !b[522] && AV_RB32(b+523) == 0x1102ff0c && !b[527]) && (AV_RB64(b + 520) & 0xFFFFFFFFFFFF) == 0x001102ff0c00
return AVPROBE_SCORE_EXTENSION + 1; && AV_RB16(b + 520)
&& AV_RB16(b + 518))
return AVPROBE_SCORE_MAX * 3 / 4;
if ( (AV_RB64(b + 8) & 0xFFFFFFFFFFFF) == 0x001102ff0c00
&& AV_RB16(b + 8)
&& AV_RB16(b + 6))
return AVPROBE_SCORE_EXTENSION / 4;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment