[FFmpeg-cvslog] avcodec/truemotion2: Fix integer overflow in tm2_decode_blocks()

Michael Niedermayer git at videolan.org
Thu Jun 27 20:47:38 EEST 2019


ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Wed Mar 27 00:39:56 2019 +0100| [6a0895bdf30821ca05516040c13addc770453ef9] | committer: Michael Niedermayer

avcodec/truemotion2: Fix integer overflow in tm2_decode_blocks()

Fixes: signed integer overflow: 255 + 2147483634 cannot be represented in type 'int'
Fixes: 13472/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5712444142387200

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 0ad0533e914a2618aea1dc77748037bd8459f61d)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 1aa7a4b870..4bfe6e14ad 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -828,7 +828,7 @@ static int tm2_decode_blocks(TM2Context *ctx, AVFrame *p)
     dst = p->data[0];
     for (j = 0; j < h; j++) {
         for (i = 0; i < w; i++) {
-            int y = Y[i], u = U[i >> 1], v = V[i >> 1];
+            unsigned y = Y[i], u = U[i >> 1], v = V[i >> 1];
             dst[3*i+0] = av_clip_uint8(y + v);
             dst[3*i+1] = av_clip_uint8(y);
             dst[3*i+2] = av_clip_uint8(y + u);



More information about the ffmpeg-cvslog mailing list