[FFmpeg-cvslog] avcodec/dnxhddec: Fix runtime error: left shift of negative value

Michael Niedermayer git at videolan.org
Fri Dec 4 14:16:45 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Dec  4 13:43:18 2015 +0100| [2ff61c3c1a0a7d8de741ba37c7662dedb6ad4b60] | committer: Michael Niedermayer

avcodec/dnxhddec: Fix runtime error: left shift of negative value

Fixes: 2abd25478c62a675f335fac00b467023/asan_static-oob_10aff98_1227_8811480c6ef1e970a7977ceb7e5a9958.mxf

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/dnxhddec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 20ca262..5c09c64 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -361,7 +361,7 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx,
         LAST_SKIP_BITS(bs, &row->gb, len);
         sign  = ~level >> 31;
         level = (NEG_USR32(sign ^ level, len) ^ sign) - sign;
-        row->last_dc[component] += level << dc_shift;
+        row->last_dc[component] += level * (1 << dc_shift);
     }
     block[0] = row->last_dc[component];
 



More information about the ffmpeg-cvslog mailing list