avformat/diracdec: check 2 chunks in probe

Fixes probetest failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/48/head
Michael Niedermayer 11 years ago
parent 023953e964
commit 2fbc759d08
  1. 15
      libavformat/diracdec.c

@ -25,10 +25,19 @@
static int dirac_probe(AVProbeData *p) static int dirac_probe(AVProbeData *p)
{ {
if (AV_RL32(p->buf) == MKTAG('B', 'B', 'C', 'D')) unsigned size;
return AVPROBE_SCORE_MAX; if (AV_RL32(p->buf) != MKTAG('B', 'B', 'C', 'D'))
else return 0;
size = AV_RB32(p->buf+5);
if (size < 13)
return 0; return 0;
if (size + 13LL > p->buf_size)
return AVPROBE_SCORE_MAX / 4;
if (AV_RL32(p->buf + size) != MKTAG('B', 'B', 'C', 'D'))
return 0;
return AVPROBE_SCORE_MAX;
} }
FF_DEF_RAWVIDEO_DEMUXER(dirac, "raw Dirac", dirac_probe, NULL, AV_CODEC_ID_DIRAC) FF_DEF_RAWVIDEO_DEMUXER(dirac, "raw Dirac", dirac_probe, NULL, AV_CODEC_ID_DIRAC)

Loading…
Cancel
Save