[FFmpeg-cvslog] libavcodec/cfhd: Fix signed overflow in shift

Michael Niedermayer git at videolan.org
Sun Jul 15 21:05:22 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Jul 14 00:24:47 2018 +0200| [7334985ffae8067b84884b5bd345db06fe2cc220] | committer: Michael Niedermayer

libavcodec/cfhd: Fix signed overflow in shift

Fixes: 8695/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4906172426485760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7334985ffae8067b84884b5bd345db06fe2cc220
---

 libavcodec/cfhd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 051d210355..ef5ebe42c5 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -541,7 +541,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
             s->peak.level   = 0;
         } else if (tag == -76) {
             s->peak.offset &= 0xffff;
-            s->peak.offset |= (data & 0xffff)<<16;
+            s->peak.offset |= (data & 0xffffU)<<16;
             s->peak.base    = (int16_t *) gb.buffer;
             s->peak.level   = 0;
         } else if (tag == -74 && s->peak.offset) {



More information about the ffmpeg-cvslog mailing list