summaryrefslogtreecommitdiff
path: root/libavcodec/libzvbi-teletextdec.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2015-10-23 20:40:23 +0200
committerMarton Balint <cus@passwd.hu>2015-10-24 16:12:26 +0200
commit5e9f14e4bf3a30934892a1801f24e838495762de (patch)
tree4f408e2a9826d26cf00b656c4a501612400d842a /libavcodec/libzvbi-teletextdec.c
parent03037a4aad8b92c00ef2f115605ad20fc4410fe5 (diff)
libzvbi-teletextdec: fix AVSubtitleRect pict compatiblity code
Only set pict if we got a valid rect. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavcodec/libzvbi-teletextdec.c')
-rw-r--r--libavcodec/libzvbi-teletextdec.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c
index c63b1ec4ac..22acd3980e 100644
--- a/libavcodec/libzvbi-teletextdec.c
+++ b/libavcodec/libzvbi-teletextdec.c
@@ -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;