Commit c5a52eb5 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 2acbbe26
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment