]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvbsubdec.c
Merge commit 'e12f1cd616573795681ce939113ac6cdad4c1f2b'
[ffmpeg] / libavcodec / dvbsubdec.c
index 85a59f3ced0d5867ac86fe402d1a05572532985d..4e08dba35c544bf7191ff2debab06a4b8476b681 100644 (file)
@@ -753,8 +753,13 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
             goto fail;
         }
 
-        for(i=0; i<sub->num_rects; i++)
+        for (i = 0; i < sub->num_rects; i++) {
             sub->rects[i] = av_mallocz(sizeof(*sub->rects[i]));
+            if (!sub->rects[i]) {
+                ret = AVERROR(ENOMEM);
+                goto fail;
+            }
+        }
 
         i = 0;