[FFmpeg-devel] [PATCH 2/4] avcodec/samidec: Check ff_htmlmarkup_to_ass() return code

Michael Niedermayer michael at niedermayer.cc
Sat May 6 03:10:48 EEST 2017


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/samidec.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c
index 16f3f58c1c..2620424750 100644
--- a/libavcodec/samidec.c
+++ b/libavcodec/samidec.c
@@ -113,10 +113,14 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
 
     av_bprint_clear(&sami->full);
     if (sami->source.len) {
-        ff_htmlmarkup_to_ass(avctx, dst_source, sami->source.str);
+        ret = ff_htmlmarkup_to_ass(avctx, dst_source, sami->source.str);
+        if (ret < 0)
+            goto end;
         av_bprintf(&sami->full, "{\\i1}%s{\\i0}\\N", sami->encoded_source.str);
     }
-    ff_htmlmarkup_to_ass(avctx, dst_content, sami->content.str);
+    ret = ff_htmlmarkup_to_ass(avctx, dst_content, sami->content.str);
+    if (ret < 0)
+        goto end;
     av_bprintf(&sami->full, "%s", sami->encoded_content.str);
 
 end:
-- 
2.11.0



More information about the ffmpeg-devel mailing list