From a8b24f214429667d2f7c784ecfe93b81fc61f818 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Sun, 15 Dec 2019 11:49:25 -0800 Subject: [PATCH] dvdsubdec: return number of bytes used Documentation says avcodec_decode_subtitle2 returns the number of bytes used. --- libavcodec/dvdsubdec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index c0c9962bad..9220285877 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -591,7 +591,11 @@ static int dvdsub_decode(AVCodecContext *avctx, is_menu = decode_dvd_subtitles(ctx, sub, buf, buf_size); if (is_menu == AVERROR(EAGAIN)) { *data_size = 0; - return appended ? 0 : append_to_cached_buf(avctx, buf, buf_size); + int ret = appended ? 0 : append_to_cached_buf(avctx, buf, buf_size); + if (ret < 0) { + return ret; + } + return buf_size; } if (is_menu < 0) { -- 2.23.0