[FFmpeg-cvslog] avcodec/diracdec: Check perspective_exp and zrs_exp.
Michael Niedermayer
git at videolan.org
Sun Sep 17 13:55:59 EEST 2017
ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Tue Aug 15 03:32:43 2017 +0200| [952393b69e666c53361fde252bc0b3f2dbabead3] | committer: Michael Niedermayer
avcodec/diracdec: Check perspective_exp and zrs_exp.
Fixes: undefined shift
Fixes: runtime error: shift exponent 264 is too large for 32-bit type 'int'
Fixes: 2860/clusterfuzz-testcase-minimized-4672811689836544
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 1e6cab874512070b36267a5a53fd053f90072fa2)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=952393b69e666c53361fde252bc0b3f2dbabead3
---
libavcodec/diracdec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index bd4ea845ca..6be3cae8d0 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1155,6 +1155,10 @@ static int dirac_unpack_prediction_parameters(DiracContext *s)
s->globalmc[ref].perspective[0] = dirac_get_se_golomb(gb);
s->globalmc[ref].perspective[1] = dirac_get_se_golomb(gb);
}
+ if (s->globalmc[ref].perspective_exp + (uint64_t)s->globalmc[ref].zrs_exp > 30) {
+ return AVERROR_INVALIDDATA;
+ }
+
}
}
More information about the ffmpeg-cvslog
mailing list