diff mbox

[FFmpeg-devel,1/2] avcodec/h264_direct: Fix runtime error: left shift of negative value -14

Message ID 20170228032830.3094-1-michael@niedermayer.cc
State Accepted
Commit 4bd3f1ce3e68a9348e97ec07a247048ea72ed808
Headers show

Commit Message

Michael Niedermayer Feb. 28, 2017, 3:28 a.m. UTC
Fixes: 682/clusterfuzz-testcase-4799120021651456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/h264_direct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer March 1, 2017, 12:16 p.m. UTC | #1
On Tue, Feb 28, 2017 at 04:28:29AM +0100, Michael Niedermayer wrote:
> Fixes: 682/clusterfuzz-testcase-4799120021651456
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/h264_direct.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

[...]
diff mbox

Patch

diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c
index 107c905db1..cbb84665b3 100644
--- a/libavcodec/h264_direct.c
+++ b/libavcodec/h264_direct.c
@@ -614,7 +614,7 @@  single_col:
 
                 {
                     const int16_t *mv_col = l1mv[x8 * 3 + y8 * b4_stride];
-                    int my_col            = (mv_col[1] << y_shift) / 2;
+                    int my_col            = (mv_col[1] * (1 << y_shift)) / 2;
                     int mx                = (scale * mv_col[0] + 128) >> 8;
                     int my                = (scale * my_col    + 128) >> 8;
                     fill_rectangle(&sl->mv_cache[0][scan8[i8 * 4]], 2, 2, 8,