[FFmpeg-cvslog] Fix out of bound writes in fix_bitshift() of the shorten decoder.

Laurent Aimar git at videolan.org
Fri Sep 30 04:26:22 CEST 2011


ffmpeg | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Sep 30 00:05:53 2011 +0200| [f42b3195d3f2692a4dfc0a8668bb4ac35301f2ed] | committer: Michael Niedermayer

Fix out of bound writes in fix_bitshift() of the shorten decoder.

The data pointers s->decoded[*] already take into account s->nwrap.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/shorten.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index b39fcbd..f46b21f 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -155,7 +155,7 @@ static void fix_bitshift(ShortenContext *s, int32_t *buffer)
 
     if (s->bitshift != 0)
         for (i = 0; i < s->blocksize; i++)
-            buffer[s->nwrap + i] <<= s->bitshift;
+            buffer[i] <<= s->bitshift;
 }
 
 



More information about the ffmpeg-cvslog mailing list