diff mbox series

[FFmpeg-devel,12/12] avcodec/decode: Reset *got_sub_ptr on error

Message ID AM7PR03MB6660697647D03573D31AEE688F729@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 8ff3fbf6bca0ee897e458fc27e5f967cdcbc16c7
Headers show
Series [FFmpeg-devel,01/12] avcodec/h2645_parse: Remove H2645NAL.rbsp_buffer | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 11, 2021, 6:40 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/decode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index afe2c0c3c1..0912f86a14 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -862,8 +862,8 @@  int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
                        "Invalid UTF-8 in decoded subtitles text; "
                        "maybe missing -sub_charenc option\n");
                 avsubtitle_free(sub);
-                ret = AVERROR_INVALIDDATA;
-                break;
+                *got_sub_ptr = 0;
+                return AVERROR_INVALIDDATA;
             }
         }