summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2019-08-12 21:17:04 +0200
committerMichael Niedermayer <[email protected]>2020-07-01 12:11:55 +0200
commitadfd49ee987817a485433b26416abfb1233b1b5d (patch)
tree893a5a5f85536df85d1820cdca7cfdcc0718366e
parent43bdd56a8c4cb0bac7f9794cb579818ef75e0a8b (diff)
avcodec/loco: Check left column value
Fixes: Timeout (42sec -> 379 ms) Fixes: 16323/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5679178099195904 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit c812db814ebd603106220854e343558ec1115e57) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/loco.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index 9a309fd063..e3746c8317 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -159,6 +159,8 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
for (j = 1; j < height; j++) {
/* restore left column */
val = loco_get_rice(&rc);
+ if (val == INT_MIN)
+ return AVERROR_INVALIDDATA;
data[0] = data[-stride] + val;
/* restore all other pixels */
for (i = 1; i < width; i++) {