diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-12-24 20:42:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-11 21:23:48 +0200 |
commit | 6d96e983f15c496c7df6953f891d588e9254a421 (patch) | |
tree | be39546d6739e2cdbe2e3634f705f4dce6e98da4 /libavformat | |
parent | 38f634ac7f6e9802c6a53680ba85341b714b9edd (diff) | |
download | ffmpeg-6d96e983f15c496c7df6953f891d588e9254a421.tar.gz |
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 <michael@niedermayer.cc>
(cherry picked from commit 78d6d8ddb571ecca54616517defbf894a45ea9c3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpc8.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index 7c6c53e2a4..e15d228e2c 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -291,7 +291,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(av_get_packet(s->pb, pkt, size) < 0) |