[FFmpeg-cvslog] avcodec/vp9: Fix undefined shifts in decode_frame_header()

Michael Niedermayer git at videolan.org
Thu Mar 12 15:53:03 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Mar 12 02:01:33 2015 +0100| [27191b82de0b28ead9b3dcce5aaf1933087fd5fb] | committer: Michael Niedermayer

avcodec/vp9: Fix undefined shifts in decode_frame_header()

Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu at google.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 265dc7e..0405c05 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -689,10 +689,10 @@ static int decode_frame_header(AVCodecContext *ctx,
         for (j = 1; j < 4; j++) {
             s->segmentation.feat[i].lflvl[j][0] =
                 av_clip_uintp2(lflvl + ((s->lf_delta.ref[j] +
-                                         s->lf_delta.mode[0]) << sh), 6);
+                                         s->lf_delta.mode[0]) * (1 << sh)), 6);
             s->segmentation.feat[i].lflvl[j][1] =
                 av_clip_uintp2(lflvl + ((s->lf_delta.ref[j] +
-                                         s->lf_delta.mode[1]) << sh), 6);
+                                         s->lf_delta.mode[1]) * (1 << sh)), 6);
         }
     }
 



More information about the ffmpeg-cvslog mailing list