]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pgssubdec.c
Merge commit 'a6653787a4b1e89170ff7962312dd110769c83a3'
[ffmpeg] / libavcodec / pgssubdec.c
index 36f1f8265a576ff7b87b03ba3e6c79ae286ea2d0..2bee31540e035b0be1551df643ff282f7c1f75b9 100644 (file)
@@ -166,7 +166,7 @@ static int decode_rle(AVCodecContext *avctx, AVSubtitleRect *rect,
 
     rle_bitmap_end = buf + buf_size;
 
-    rect->pict.data[0] = av_malloc(rect->w * rect->h);
+    rect->pict.data[0] = av_malloc_array(rect->w, rect->h);
 
     if (!rect->pict.data[0])
         return AVERROR(ENOMEM);
@@ -509,7 +509,7 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
     // Blank if last object_count was 0.
     if (!ctx->presentation.object_count)
         return 1;
-    sub->rects = av_mallocz(sizeof(*sub->rects) * ctx->presentation.object_count);
+    sub->rects = av_mallocz_array(ctx->presentation.object_count, sizeof(*sub->rects));
     if (!sub->rects) {
         return AVERROR(ENOMEM);
     }