Commit fa0792f7 authored by reimar's avatar reimar

Make dnxhd probe more strict, fail if we detect values in header that would

make our decoder fail anyway.
dnxhd probe now passes probetest.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19847 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 89a1e0a4
...@@ -580,10 +580,19 @@ static int dirac_probe(AVProbeData *p) ...@@ -580,10 +580,19 @@ static int dirac_probe(AVProbeData *p)
static int dnxhd_probe(AVProbeData *p) static int dnxhd_probe(AVProbeData *p)
{ {
static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01}; static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
if (!memcmp(p->buf, header, 5)) int w, h, compression_id;
return AVPROBE_SCORE_MAX; if (p->buf_size < 0x2c)
else return 0;
if (memcmp(p->buf, header, 5))
return 0;
h = AV_RB16(p->buf + 0x18);
w = AV_RB16(p->buf + 0x1a);
if (!w || !h)
return 0;
compression_id = AV_RB32(p->buf + 0x28);
if (compression_id < 1237 || compression_id > 1253)
return 0; return 0;
return AVPROBE_SCORE_MAX;
} }
#endif #endif
......
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