Commit eb54efc1 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/ac3dec: Check buf2 before adding 16 in ac3_eac3_probe()

This is needed since e0250cf3 as that uses end-buf2
Note, there are more than 16 bytes allocated beyond "end"

Fixes: regression (segfault) with probetest
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 80137531
......@@ -47,8 +47,11 @@ static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
uint16_t frame_size;
int i, ret;
if(!memcmp(buf2, "\x1\x10\0\0\0\0\0\0", 8))
if(!memcmp(buf2, "\x1\x10\0\0\0\0\0\0", 8)) {
if (buf2 + 16 > end)
break;
buf2+=16;
}
if (buf[0] == 0x77 && buf[1] == 0x0B) {
for(i=0; i<8; i+=2) {
buf3[i ] = buf2[i+1];
......
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