[FFmpeg-cvslog] avcodec/prosumer: Check remaining space in put byte context
Michael Niedermayer
git at videolan.org
Mon Sep 24 01:59:44 EEST 2018
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Sep 22 18:14:07 2018 +0200| [0f36ad514c45b8267b661e745607411d9a5b42cb] | committer: Michael Niedermayer
avcodec/prosumer: Check remaining space in put byte context
Fixes: Timeout
Fixes: 10053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5636993883570176
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f36ad514c45b8267b661e745607411d9a5b42cb
---
libavcodec/prosumer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c
index 2420dd5f12..6e98677b55 100644
--- a/libavcodec/prosumer.c
+++ b/libavcodec/prosumer.c
@@ -57,6 +57,8 @@ static int decompress(GetByteContext *gb, int size, PutByteContext *pb, const ui
b = lut[2 * idx];
while (1) {
+ if (bytestream2_get_bytes_left_p(pb) <= 0)
+ return 0;
if (((b & 0xFF00u) != 0x8000u) || (b & 0xFFu)) {
if ((b & 0xFF00u) != 0x8000u) {
bytestream2_put_le16(pb, b);
More information about the ffmpeg-cvslog
mailing list