[FFmpeg-cvslog] Fix linesize for some rawvideo samples with odd width.

Carl Eugen Hoyos git at videolan.org
Thu Jun 30 09:03:28 CEST 2011


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Jun 30 09:02:14 2011 +0200| [3713cf11c62df4d993272843c7ef57a1dca3a386] | committer: Carl Eugen Hoyos

Fix linesize for some rawvideo samples with odd width.

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

 libavcodec/rawdec.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 04aa51e..6644d6c 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -192,7 +192,13 @@ static int raw_decode(AVCodecContext *avctx,
             frame->palette_has_changed = 1;
         }
     }
-    if(avctx->pix_fmt==PIX_FMT_BGR24 && ((frame->linesize[0]+3)&~3)*avctx->height <= buf_size)
+    if((avctx->pix_fmt==PIX_FMT_BGR24    ||
+        avctx->pix_fmt==PIX_FMT_GRAY8    ||
+        avctx->pix_fmt==PIX_FMT_RGB555LE ||
+        avctx->pix_fmt==PIX_FMT_RGB555BE ||
+        avctx->pix_fmt==PIX_FMT_RGB565LE ||
+        avctx->pix_fmt==PIX_FMT_PAL8) &&
+        ((frame->linesize[0]+3)&~3)*avctx->height <= buf_size)
         frame->linesize[0] = (frame->linesize[0]+3)&~3;
 
     if(context->flip)



More information about the ffmpeg-cvslog mailing list