avformat/ac4dec: Check remaining space in ac4_probe()

Fixes: CID1538298 Untrusted loop bound
Fixes: undefined behavior

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2f04cb673c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.0
Michael Niedermayer 9 months ago
parent 4175b43533
commit 78ad74a20a
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavformat/ac4dec.c

@ -43,6 +43,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;

Loading…
Cancel
Save