Browse code

lavc/samidec: properly raise errors from sami_paragraph_to_ass()

Clément Bœsch authored on 2017/11/30 06:23:36
Showing 1 changed files
... ...
@@ -138,9 +138,12 @@ static int sami_decode_frame(AVCodecContext *avctx,
138 138
     const char *ptr = avpkt->data;
139 139
     SAMIContext *sami = avctx->priv_data;
140 140
 
141
-    if (ptr && avpkt->size > 0 && !sami_paragraph_to_ass(avctx, ptr)) {
141
+    if (ptr && avpkt->size > 0) {
142
+        int ret = sami_paragraph_to_ass(avctx, ptr);
143
+        if (ret < 0)
144
+            return ret;
142 145
         // TODO: pass escaped sami->encoded_source.str as source
143
-        int ret = ff_ass_add_rect(sub, sami->full.str, sami->readorder++, 0, NULL, NULL);
146
+        ret = ff_ass_add_rect(sub, sami->full.str, sami->readorder++, 0, NULL, NULL);
144 147
         if (ret < 0)
145 148
             return ret;
146 149
     }