diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-21 01:11:01 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-07-10 02:18:52 +0300 |
commit | d81e0f925a94a3d4f2a1c85447dc1d938e1e4fe5 (patch) | |
tree | 62ae2ec6fa4b1933fc9e0086ed45c92c8c80bbf3 /libavcodec/cavsdec.c | |
parent | 84bf347ff054a928e69debb3d84b7c4f9d1a832e (diff) |
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>
Diffstat (limited to 'libavcodec/cavsdec.c')
-rw-r--r-- | libavcodec/cavsdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 3aec0dd5e5..289ed1b242 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1068,6 +1068,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; } |