[FFmpeg-cvslog] msrle: correctly round linesize for < 8 bpp formats.

Reimar Döffinger git at videolan.org
Wed Aug 17 22:13:58 CEST 2011


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Tue Aug 16 23:41:09 2011 +0200| [4fe796b32a36aab98cbb5f2bddaddc4db1ad64de] | committer: Reimar Döffinger

msrle: correctly round linesize for < 8 bpp formats.

Fixes trac issue #338.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

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

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

diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index 8f1f259..b9531f3 100644
--- a/libavcodec/msrle.c
+++ b/libavcodec/msrle.c
@@ -107,7 +107,7 @@ static int msrle_decode_frame(AVCodecContext *avctx,
 
     /* FIXME how to correctly detect RLE ??? */
     if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
-        int linesize = avctx->width * avctx->bits_per_coded_sample / 8;
+        int linesize = (avctx->width * avctx->bits_per_coded_sample + 7) / 8;
         uint8_t *ptr = s->frame.data[0];
         uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
         int i, j;



More information about the ffmpeg-cvslog mailing list