Commit 5e9f14e4 authored by Marton Balint's avatar Marton Balint

libzvbi-teletextdec: fix AVSubtitleRect pict compatiblity code

Only set pict if we got a valid rect.
Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent 03037a4a
......@@ -464,18 +464,17 @@ static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *data_si
if (sub->rects) {
sub->num_rects = 1;
sub->rects[0] = ctx->pages->sub_rect;
} else {
ret = AVERROR(ENOMEM);
}
#if FF_API_AVPICTURE
FF_DISABLE_DEPRECATION_WARNINGS
for (j = 0; j < 4; j++) {
sub->rects[0]->pict.data[j] = sub->rects[0]->data[j];
sub->rects[0]->pict.linesize[j] = sub->rects[0]->linesize[j];
}
for (j = 0; j < 4; j++) {
sub->rects[0]->pict.data[j] = sub->rects[0]->data[j];
sub->rects[0]->pict.linesize[j] = sub->rects[0]->linesize[j];
}
FF_ENABLE_DEPRECATION_WARNINGS
#endif
} else {
ret = AVERROR(ENOMEM);
}
} else {
av_log(avctx, AV_LOG_DEBUG, "sending empty sub\n");
sub->rects = NULL;
......
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