summaryrefslogtreecommitdiff
path: root/libavcodec/rasc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-12-15 00:10:17 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-01-21 07:53:26 +0100
commit321c418b8715e9b3142648561dcd1fd6494a9d62 (patch)
tree58b1c9bfcd7d76db8f905dd9a63dd315cadea2bb /libavcodec/rasc.c
parentf5859d4a8ee22f73d75d6b498d459700b034dd55 (diff)
downloadffmpeg-321c418b8715e9b3142648561dcd1fd6494a9d62.tar.gz
avcodec/rasc: Check that the number of moves is less than or equal the number of pixels
Fixes: OOM Fixes: 10307/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5393974559244288 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 092cb17983b2660b4e050a05c739060f8e03d27a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/rasc.c')
-rw-r--r--libavcodec/rasc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/rasc.c b/libavcodec/rasc.c
index 67351dfd19..1b607ac31e 100644
--- a/libavcodec/rasc.c
+++ b/libavcodec/rasc.c
@@ -215,7 +215,7 @@ static int decode_move(AVCodecContext *avctx,
bytestream2_skip(gb, 8);
compression = bytestream2_get_le32(gb);
- if (nb_moves > INT32_MAX / 16)
+ if (nb_moves > INT32_MAX / 16 || nb_moves > avctx->width * avctx->height)
return AVERROR_INVALIDDATA;
uncompressed_size = 16 * nb_moves;