X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fpgssubdec.c;h=b50b37b206bfa206f33beaa44aabbcb71ef53e60;hb=c5c6e307812a72b7f4ecc5a88db221a9b9a003d2;hp=cef477d8c206942bb30cd16e8cea837e5ec42e30;hpb=1bc6cdf2fcbd3caea7b78d0a617c6e338606d756;p=ffmpeg diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index cef477d8c20..b50b37b206b 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -556,12 +556,13 @@ static int display_end_segment(AVCodecContext *avctx, void *data, sub->rects[i]->x = ctx->presentation.objects[i].x; sub->rects[i]->y = ctx->presentation.objects[i].y; - sub->rects[i]->w = object->w; - sub->rects[i]->h = object->h; - - sub->rects[i]->linesize[0] = object->w; if (object->rle) { + sub->rects[i]->w = object->w; + sub->rects[i]->h = object->h; + + sub->rects[i]->linesize[0] = object->w; + if (object->rle_remaining_len) { av_log(avctx, AV_LOG_ERROR, "RLE data length %u is %u bytes shorter than expected\n", object->rle_data_len, object->rle_remaining_len);