summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-10-31 03:06:59 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-11-02 23:46:31 +0100
commit9acdf17b2c30c44e6e6a3d3b3c22989b7e1117c3 (patch)
tree3dfb3357e549bb809ef415ce7d866036235afe1b
parent8e50215b5e02074b0773dfcf55867654ee59c179 (diff)
avcodec/prosumer: Check for bytestream eof in decompress()
Fixes: Infinite loop Fixes: 10685/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5652236881887232 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/prosumer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c
index 6e98677b55..2fd9880ee1 100644
--- a/libavcodec/prosumer.c
+++ b/libavcodec/prosumer.c
@@ -57,7 +57,7 @@ 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)
+ if (bytestream2_get_bytes_left_p(pb) <= 0 || bytestream2_get_eof(pb))
return 0;
if (((b & 0xFF00u) != 0x8000u) || (b & 0xFFu)) {
if ((b & 0xFF00u) != 0x8000u) {