avcodec/decode: Reset *got_sub_ptr on error

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-12-10 23:20:57 +01:00
parent 6e02ca35e5
commit 8ff3fbf6bc
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}