Re: [FFmpeg-devel] [PATCH] avcodec/truemotion2: Fix several integer overflows in tm2_motion_block()

2019-07-31 Thread Michael Niedermayer
On Tue, Jul 09, 2019 at 06:00:00PM +0200, Michael Niedermayer wrote:
> Fixes: 
> 15524/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5173148372172800
> Fixes: signed integer overflow: 13701388 - -2134868270 cannot be represented 
> in type 'int'
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/truemotion2.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

will apply


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH] avcodec/truemotion2: Fix several integer overflows in tm2_motion_block()

2019-07-09 Thread Michael Niedermayer
Fixes: 
15524/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5173148372172800
Fixes: signed integer overflow: 13701388 - -2134868270 cannot be represented in 
type 'int'

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/truemotion2.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index a86dd16e0f..5d6dfc24c3 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -764,10 +764,10 @@ static inline void tm2_motion_block(TM2Context *ctx, 
AVFrame *pic, int bx, int b
 }
 /* calculate deltas */
 Y -= Ystride * 4;
-ctx->D[0] = Y[3] - last[3];
-ctx->D[1] = Y[3 + Ystride] - Y[3];
-ctx->D[2] = Y[3 + Ystride * 2] - Y[3 + Ystride];
-ctx->D[3] = Y[3 + Ystride * 3] - Y[3 + Ystride * 2];
+ctx->D[0] = (unsigned)Y[3] - last[3];
+ctx->D[1] = (unsigned)Y[3 + Ystride] - Y[3];
+ctx->D[2] = (unsigned)Y[3 + Ystride * 2] - Y[3 + Ystride];
+ctx->D[3] = (unsigned)Y[3 + Ystride * 3] - Y[3 + Ystride * 2];
 for (i = 0; i < 4; i++)
 last[i] = Y[i + Ystride * 3];
 }
-- 
2.22.0

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

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