diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-20 23:11:01 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-22 00:29:27 +0100 |
commit | ae2eb04648839bfc6c61c32cb0f124e91bb7ff8e (patch) | |
tree | 901f393179dde99e6cfbd907eb735f3b83251603 /libavcodec/cavsdec.c | |
parent | 4f8c691040b026d001ff33d38c0e1516a35b946e (diff) | |
download | ffmpeg-ae2eb04648839bfc6c61c32cb0f124e91bb7ff8e.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>
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 06c752735e..c7fff67c06 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; } |