diff options
author | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2019-07-01 01:45:36 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2019-08-11 23:43:14 +0200 |
commit | ea56af88956061d700043c5c4b026ac57834b0c8 (patch) | |
tree | a2dae7274ef8c42c8bcb5a0e069d201a204868a3 /libavcodec/zmbvenc.c | |
parent | 686755f02b0214155f3a044f263c2b60abdf9800 (diff) | |
download | ffmpeg-ea56af88956061d700043c5c4b026ac57834b0c8.tar.gz |
lavc/zmbvenc: Do not left-shift negative values.
Fixes the following ubsan errors with the sample from ticket #7980:
libavcodec/zmbvenc.c:243:29: runtime error: left shift of negative value -4
libavcodec/zmbvenc.c:244:28: runtime error: left shift of negative value -2
Diffstat (limited to 'libavcodec/zmbvenc.c')
-rw-r--r-- | libavcodec/zmbvenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index 48871758e0..0e22ce687f 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -240,8 +240,8 @@ FF_ENABLE_DEPRECATION_WARNINGS tprev = prev + x * c->bypp; zmbv_me(c, tsrc, p->linesize[0], tprev, c->pstride, x, y, &mx, &my, &xored); - mv[0] = (mx << 1) | !!xored; - mv[1] = my << 1; + mv[0] = (mx * 2) | !!xored; + mv[1] = my * 2; tprev += mx * c->bypp + my * c->pstride; if(xored){ for(j = 0; j < bh2; j++){ |