[FFmpeg-devel] [PATCH] avocdec/snowenc: Fix left shift of negative number

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue Sep 27 04:47:15 EEST 2022


Fixes the vsynth(1|2|_lena)-snow-ll FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/snowenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index b647fc9016..c5ff50639e 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1814,7 +1814,7 @@ redo_frame:
             if(s->qlog == LOSSLESS_QLOG){
                 for(y=0; y<h; y++){
                     for(x=0; x<w; x++){
-                        s->spatial_idwt_buffer[y*w + x]<<=FRAC_BITS;
+                        s->spatial_idwt_buffer[y*w + x] *= 1 << FRAC_BITS;
                     }
                 }
             }
-- 
2.34.1



More information about the ffmpeg-devel mailing list