Fix memcpy out-of-bounds.
authorMichel Bardiaux <mbardiaux@peaktime.be>
Wed, 31 Jan 2007 11:19:48 +0000 (11:19 +0000)
committerDiego Biurrun <diego@biurrun.de>
Wed, 31 Jan 2007 11:19:48 +0000 (11:19 +0000)
patch by Michel Bardiaux, mbardiaux mediaxim be

Originally committed as revision 7780 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/bmp.c

index 20cca16..30eee65 100644 (file)
@@ -187,7 +187,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
     switch(depth){
     case 24:
         for(i = 0; i < avctx->height; i++){
-            memcpy(ptr, buf, n);
+            memcpy(ptr, buf, avctx->width*(depth>>3));
             buf += n;
             ptr += linesize;
         }