From bbf02f7d288681d2ba6d522a99e6341dc3984247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Sun, 1 May 2016 14:53:53 +0200 Subject: [PATCH] lavc: override decode return value only in case of error Fixes Ticket #5350 Regression since 29412821241050c846dbceaad4b9752857659977. --- libavcodec/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index ffbabb1061..e6609ef9b2 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -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