Commit 99551232 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

pgssubdec: only set w/h/linesize when allocating data

Rects with positive w/h/linesize but no data are invalid.
Reviewed-by: 's avatarPetri Hintukainen <phintuka@gmail.com>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 0700d02a
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment