diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 8f1f25966b..b9531f34d7 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;