summaryrefslogtreecommitdiff
path: root/libavcodec/loco.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-25 21:48:26 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 11:30:43 +0100
commitb0c5ec9ab49069d3cd3701a689ac73888fc58231 (patch)
tree1d3a350788960fc2c8abf9244da60abfd6528ccd /libavcodec/loco.c
parentba148f232930a23984808f625439ed83c2161870 (diff)
downloadffmpeg-b0c5ec9ab49069d3cd3701a689ac73888fc58231.tar.gz
avcodec/loco: Check for end of input in the first line
Fixes: Timeout (85sec -> 0.1sec) Fixes: 17634/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5666410809786368 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> (cherry picked from commit c5a52eb5cd5613cfede81648a58cd95088d0a3a7) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/loco.c')
-rw-r--r--libavcodec/loco.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index d8bf68a100..e891d83ece 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -155,6 +155,8 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
/* restore top line */
for (i = 1; i < width; i++) {
val = loco_get_rice(&rc);
+ if (val == INT_MIN)
+ return AVERROR_INVALIDDATA;
data[i] = data[i - 1] + val;
}
data += stride;