OSDN Git Service

msrle: correctly round linesize for < 8 bpp formats.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Tue, 16 Aug 2011 21:41:09 +0000 (23:41 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 17 Aug 2011 20:13:36 +0000 (22:13 +0200)
Fixes trac issue #338.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
libavcodec/msrle.c

index 8f1f259..b9531f3 100644 (file)
@@ -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;