From 100a46bdaee1d399d47099eafa917e381c208573 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Wed, 20 Mar 2024 09:11:51 +0100 Subject: [PATCH 06/16] 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 bee42e3c61..146996bc23 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -547,7 +547,11 @@ static int dvdsub_decode(AVCodecContext *avctx, AVSubtitle *sub, 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.39.3 (Apple Git-146)