diff --git a/libavformat/ac4dec.c b/libavformat/ac4dec.c index 71950f52dc..2952036c25 100644 --- a/libavformat/ac4dec.c +++ b/libavformat/ac4dec.c @@ -42,6 +42,8 @@ static int ac4_probe(const AVProbeData *p) size += 4; if (buf[1] == 0x41) size += 2; + if (left < size) + break; max_frames++; left -= size; buf += size;