OSDN Git Service

avcodec/samidec: Check ff_htmlmarkup_to_ass() return code
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 5 May 2017 23:50:58 +0000 (01:50 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 8 May 2017 15:02:02 +0000 (17:02 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/samidec.c

index 16f3f58..2620424 100644 (file)
@@ -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: