summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2020-12-24 20:42:27 +0100
committerMichael Niedermayer <[email protected]>2021-02-02 14:18:21 +0100
commit50d9e4b48c55448b90eb490f518dfe9b25f3b4e7 (patch)
tree4f242962040a5ea5c138b8ab3e9c57f71ad22ed5
parent87c071a7c86005ab68fa639401093eee1891cb03 (diff)
avformat/mpc8: Check size before implicitly converting to int
Fixes: Timeout Fixes: 28551/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6229183210586112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 78d6d8ddb571ecca54616517defbf894a45ea9c3) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/mpc8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 99f713eb76..f33323a599 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -292,7 +292,7 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR_EOF;
mpc8_get_chunk_header(s->pb, &tag, &size);
- if (size < 0)
+ if (size < 0 || size > INT_MAX)
return -1;
if(tag == TAG_AUDIOPACKET){
if ((ret = av_get_packet(s->pb, pkt, size)) < 0)