X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmsrle.c;h=b9531f34d74558128f6bb552b31ea6a27f381775;hb=6c1fb3e7631178c2a45c6c41b9b8d9ee3a5298fc;hp=496eb40916777e5e5f9ab6c6c2156f2c89f3be49;hpb=f52ad8ceddf3078dbfef7ab437ca8600a1f96ef2;p=ffmpeg diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 496eb409167..b9531f34d74 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; @@ -149,14 +149,13 @@ static av_cold int msrle_decode_end(AVCodecContext *avctx) } AVCodec ff_msrle_decoder = { - "msrle", - AVMEDIA_TYPE_VIDEO, - CODEC_ID_MSRLE, - sizeof(MsrleContext), - msrle_decode_init, - NULL, - msrle_decode_end, - msrle_decode_frame, - CODEC_CAP_DR1, + .name = "msrle", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_MSRLE, + .priv_data_size = sizeof(MsrleContext), + .init = msrle_decode_init, + .close = msrle_decode_end, + .decode = msrle_decode_frame, + .capabilities = CODEC_CAP_DR1, .long_name= NULL_IF_CONFIG_SMALL("Microsoft RLE"), };