diff mbox series

[FFmpeg-devel,12/30] avcodec/mpegvideo: Don't zero-initialize unnecessarily

Message ID 20201230233157.1055287-12-andreas.rheinhardt@gmail.com
State Accepted
Commit 0d61a1cfad23ceac8104d0c00f98399de9d91069
Headers show
Series [FFmpeg-devel,01/30] avcodec/opustab: Make array static
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 30, 2020, 11:31 p.m. UTC
mbintra_table will be memset to 1 a few lines after its allocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/mpegvideo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Dec. 31, 2020, 12:19 a.m. UTC | #1
On Thu, Dec 31, 2020 at 12:31:39AM +0100, Andreas Rheinhardt wrote:
> mbintra_table will be memset to 1 a few lines after its allocation.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/mpegvideo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

should be ok

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index c28d1adef7..f487864de6 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -790,7 +790,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);