summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2018-11-17 00:38:53 +0100
committerMichael Niedermayer <[email protected]>2019-12-02 15:45:24 +0100
commitc78d5c9ce93ec26976a9b977b2f5398e5b7936ef (patch)
treed3ba77f4bf51520f8cf624c123d1917651f4a4c9
parent266b784bb3698120dfea9de6dce562df9bebd845 (diff)
avcodec/truemotion2: fix integer overflows in tm2_low_chroma()
Fixes: 11295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-4888953459572736 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 2ae39d795613f3c6925c59852b625029b747fe42) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/truemotion2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index d290326bf5..0bce97fef0 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -472,7 +472,7 @@ static inline void tm2_high_chroma(int *data, int stride, int *last, unsigned *C
}
}
-static inline void tm2_low_chroma(int *data, int stride, int *clast, int *CD, int *deltas, int bx)
+static inline void tm2_low_chroma(int *data, int stride, int *clast, unsigned *CD, int *deltas, int bx)
{
int t;
int l;
@@ -482,8 +482,8 @@ static inline void tm2_low_chroma(int *data, int stride, int *clast, int *CD, in
prev = clast[-3];
else
prev = 0;
- t = (CD[0] + CD[1]) >> 1;
- l = (prev - CD[0] - CD[1] + clast[1]) >> 1;
+ t = (int)(CD[0] + CD[1]) >> 1;
+ l = (int)(prev - CD[0] - CD[1] + clast[1]) >> 1;
CD[1] = CD[0] + CD[1] - t;
CD[0] = t;
clast[0] = l;