lavc: override decode return value only in case of error
authorClément Bœsch <u@pkh.me>
Sun, 1 May 2016 12:53:53 +0000 (14:53 +0200)
committerClément Bœsch <u@pkh.me>
Sun, 1 May 2016 12:53:53 +0000 (14:53 +0200)
Fixes Ticket #5350

Regression since 29412821241050c846dbceaad4b9752857659977.

libavcodec/utils.c

index ffbabb1..e6609ef 100644 (file)
@@ -2633,7 +2633,9 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
                 && *got_sub_ptr && sub->num_rects) {
                 const AVRational tb = avctx->pkt_timebase.num ? avctx->pkt_timebase
                                                               : avctx->time_base;
-                ret = convert_sub_to_old_ass_form(sub, avpkt, tb);
+                int err = convert_sub_to_old_ass_form(sub, avpkt, tb);
+                if (err < 0)
+                    ret = err;
             }
 #endif