avi bgr24 padding fix.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Apr 2010 22:09:42 +0000 (22:09 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Apr 2010 22:09:42 +0000 (22:09 +0000)
Fixes issue1901

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

libavcodec/rawdec.c

index 6caa752..8b398d2 100644 (file)
@@ -152,6 +152,8 @@ static int raw_decode(AVCodecContext *avctx,
         memcpy(frame->data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
         avctx->palctrl->palette_changed = 0;
     }
         memcpy(frame->data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
         avctx->palctrl->palette_changed = 0;
     }
+    if(avctx->pix_fmt==PIX_FMT_BGR24 && ((frame->linesize[0]+3)&~3)*avctx->height <= buf_size)
+        frame->linesize[0] = (frame->linesize[0]+3)&~3;
 
     if(context->flip)
         flip(avctx, picture);
 
     if(context->flip)
         flip(avctx, picture);