[FFmpeg-cvslog] avcodec/mpegvideo: Don't zero-initialize unnecessarily

Andreas Rheinhardt git at videolan.org
Fri Jan 1 01:07:27 EET 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Dec 27 21:16:08 2020 +0100| [0d61a1cfad23ceac8104d0c00f98399de9d91069] | committer: Andreas Rheinhardt

avcodec/mpegvideo: Don't zero-initialize unnecessarily

mbintra_table will be memset to 1 a few lines after its allocation.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0d61a1cfad23ceac8104d0c00f98399de9d91069
---

 libavcodec/mpegvideo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f92792ae98..60ed716865 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -787,7 +787,7 @@ static int init_context_frame(MpegEncContext *s)
     }
 
     /* which mb is an intra block,  init macroblock skip table */
-    if (!FF_ALLOCZ_TYPED_ARRAY(s->mbintra_table, mb_array_size) ||
+    if (!FF_ALLOC_TYPED_ARRAY(s->mbintra_table, 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))
         return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list