[FFmpeg-cvslog] avcodec/dirac_dwt_template: Fix signedness regression in interleave()

Michael Niedermayer git at videolan.org
Thu Jul 19 00:28:05 EEST 2018


ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Fri Jul 13 18:33:08 2018 +0200| [fe73afd730be56877221e415e7d32f5f4ae24b7a] | committer: Michael Niedermayer

avcodec/dirac_dwt_template: Fix signedness regression in interleave()

Found-by: <jdarnley>
Tested-by: James Darnley <james.darnley at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 181435a4de6e38e0a15ddaf16de9a157ef41cb18)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/dirac_dwt_template.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dirac_dwt_template.c b/libavcodec/dirac_dwt_template.c
index 528fc7e9e7..2369c8d15b 100644
--- a/libavcodec/dirac_dwt_template.c
+++ b/libavcodec/dirac_dwt_template.c
@@ -57,8 +57,8 @@ static av_always_inline void RENAME(interleave)(TYPE *dst, TYPE *src0, TYPE *src
 {
     int i;
     for (i = 0; i < w2; i++) {
-        dst[2*i  ] = (src0[i] + (unsigned)add) >> shift;
-        dst[2*i+1] = (src1[i] + (unsigned)add) >> shift;
+        dst[2*i  ] = ((int)(src0[i] + (unsigned)add)) >> shift;
+        dst[2*i+1] = ((int)(src1[i] + (unsigned)add)) >> shift;
     }
 }
 



More information about the ffmpeg-cvslog mailing list