diff mbox series

[FFmpeg-devel,03/10] avcodec/mpegvideo: Avoid macro/av_calloc for ordinary allocations

Message ID AM7PR03MB66601BA4A9570060D9DCED8E8F4B9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit de29d482f9ee8d9cea9c58a1370ab99028adff3f
Headers show
Series [FFmpeg-devel,01/10] avcodec/mpeg12dec: Don't set write-only variable | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 5, 2022, 9:56 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpegvideo.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index af433153f2..e9f2fb212a 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -632,9 +632,9 @@  int ff_mpv_init_context_frame(MpegEncContext *s)
 
     if (s->out_format == FMT_H263) {
         /* cbp values, cbp, ac_pred, pred_dir */
-        if (!FF_ALLOCZ_TYPED_ARRAY(s->coded_block_base, y_size + (s->mb_height&1)*2*s->b8_stride) ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->cbp_table,        mb_array_size)                            ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->pred_dir_table,   mb_array_size))
+        if (!(s->coded_block_base = av_mallocz(y_size + (s->mb_height&1)*2*s->b8_stride)) ||
+            !(s->cbp_table        = av_mallocz(mb_array_size)) ||
+            !(s->pred_dir_table   = av_mallocz(mb_array_size)))
             return AVERROR(ENOMEM);
         s->coded_block = s->coded_block_base + s->b8_stride + 1;
     }
@@ -652,9 +652,9 @@  int ff_mpv_init_context_frame(MpegEncContext *s)
     }
 
     /* which mb is an intra block,  init macroblock skip table */
-    if (!FF_ALLOC_TYPED_ARRAY(s->mbintra_table, mb_array_size) ||
+    if (!(s->mbintra_table = av_mallocz(mb_array_size)) ||
         // Note the + 1 is for a quicker MPEG-4 slice_end detection
-        !FF_ALLOCZ_TYPED_ARRAY(s->mbskip_table,  mb_array_size + 2))
+        !(s->mbskip_table  = av_mallocz(mb_array_size + 2)))
         return AVERROR(ENOMEM);
     memset(s->mbintra_table, 1, mb_array_size);