[FFmpeg-cvslog] avcodec/diracdec: Fixes integer overflow
Michael Niedermayer
git at videolan.org
Sun Sep 17 13:56:07 EEST 2017
ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Tue Aug 15 03:32:44 2017 +0200| [5bc3b18e3d98059ffd6ec0844b1aeca1f7f41360] | committer: Michael Niedermayer
avcodec/diracdec: Fixes integer overflow
Fixes: runtime error: signed integer overflow: 340018243 * 27 cannot be represented in type 'int'
Fixes: 2861/clusterfuzz-testcase-minimized-5361070510178304
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 92da23093c784b1d9f0db4db51d28ea80a59e759)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5bc3b18e3d98059ffd6ec0844b1aeca1f7f41360
---
libavcodec/diracdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 6be3cae8d0..e147f10564 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -436,7 +436,7 @@ static av_cold int dirac_decode_end(AVCodecContext *avctx)
static inline int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset)
{
int coeff = dirac_get_se_golomb(gb);
- const int sign = FFSIGN(coeff);
+ const unsigned sign = FFSIGN(coeff);
if (coeff)
coeff = sign*((sign * coeff * qfactor + qoffset) >> 2);
return coeff;
More information about the ffmpeg-cvslog
mailing list