[FFmpeg-cvslog] avcodec/truemotion2: Fix 2 integer overflows in tm2_low_res_block()

2020-04-23 Thread Michael Niedermayer
ffmpeg | branch: release/2.8 | Michael Niedermayer  | 
Tue Nov 12 18:47:52 2019 +0100| [3510a1869edf4cd2678c7126989a5464fcd97f7d] | 
committer: Michael Niedermayer

avcodec/truemotion2: Fix 2 integer overflows in tm2_low_res_block()

Fixes: signed integer overflow: 1778647621 + 574372924 cannot be represented in 
type 'int'
Fixes: 
18692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-6248679635943424

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 93d52a181ec050d3a4fb68f526604d39cd006be5)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/truemotion2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index d4bd698e9f..5b9fa565fd 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -565,10 +565,10 @@ static inline void tm2_low_res_block(TM2Context *ctx, 
AVFrame *pic, int bx, int
 last[0] = (int)((unsigned)last[1]  - ctx->D[0] - ctx->D[1] - ctx->D[2] 
- ctx->D[3])>> 1;
 last[2] = (int)((unsigned)last[1] + last[3]) >> 1;
 
-t1 = ctx->D[0] + ctx->D[1];
+t1 = ctx->D[0] + (unsigned)ctx->D[1];
 ctx->D[0] = t1 >> 1;
 ctx->D[1] = t1 - (t1 >> 1);
-t2 = ctx->D[2] + ctx->D[3];
+t2 = ctx->D[2] + (unsigned)ctx->D[3];
 ctx->D[2] = t2 >> 1;
 ctx->D[3] = t2 - (t2 >> 1);
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/truemotion2: Fix 2 integer overflows in tm2_low_res_block()

2019-12-10 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Nov 12 18:47:52 2019 +0100| [93d52a181ec050d3a4fb68f526604d39cd006be5] | 
committer: Michael Niedermayer

avcodec/truemotion2: Fix 2 integer overflows in tm2_low_res_block()

Fixes: signed integer overflow: 1778647621 + 574372924 cannot be represented in 
type 'int'
Fixes: 
18692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-6248679635943424

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 libavcodec/truemotion2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index fbdb657363..7d70746339 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -586,10 +586,10 @@ static inline void tm2_low_res_block(TM2Context *ctx, 
AVFrame *pic, int bx, int
 last[0] = (int)((unsigned)last[1]  - ctx->D[0] - ctx->D[1] - ctx->D[2] 
- ctx->D[3])>> 1;
 last[2] = (int)((unsigned)last[1] + last[3]) >> 1;
 
-t1 = ctx->D[0] + ctx->D[1];
+t1 = ctx->D[0] + (unsigned)ctx->D[1];
 ctx->D[0] = t1 >> 1;
 ctx->D[1] = t1 - (t1 >> 1);
-t2 = ctx->D[2] + ctx->D[3];
+t2 = ctx->D[2] + (unsigned)ctx->D[3];
 ctx->D[2] = t2 >> 1;
 ctx->D[3] = t2 - (t2 >> 1);
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".