aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-02-20 23:11:01 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-04-13 00:35:15 +0200
commitf3562ee6fc847db3162fccfa98449ce21404608e (patch)
tree5fa41e66ee1f2a182370c75d3000363ef01e7f86
parentb9d5b1f05dadf6ab3062f59e7a2cbc482e655cb8 (diff)
downloadffmpeg-f3562ee6fc847db3162fccfa98449ce21404608e.tar.gz
avcodec/cavsdec: Check alpha/beta offset
Fixes: Integer overflow Fixes: 6183/clusterfuzz-testcase-minimized-6269224436629504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ae2eb04648839bfc6c61c32cb0f124e91bb7ff8e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/cavsdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 2bcb42a6eb..79349b5005 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -1067,6 +1067,11 @@ static int decode_pic(AVSContext *h)
if (!h->loop_filter_disable && get_bits1(&h->gb)) {
h->alpha_offset = get_se_golomb(&h->gb);
h->beta_offset = get_se_golomb(&h->gb);
+ if ( h->alpha_offset < -64 || h->alpha_offset > 64
+ || h-> beta_offset < -64 || h-> beta_offset > 64) {
+ h->alpha_offset = h->beta_offset = 0;
+ return AVERROR_INVALIDDATA;
+ }
} else {
h->alpha_offset = h->beta_offset = 0;
}