[FFmpeg-cvslog] avcodec/mpegvideo: Zero-init mbintra_table

Andreas Rheinhardt git at videolan.org
Sat Jun 21 23:21:21 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Jun 13 07:44:59 2025 +0200| [c4fd33a9515926948e28be1048d0ea69dbf6f3bf] | committer: Andreas Rheinhardt

avcodec/mpegvideo: Zero-init mbintra_table

Up until now, they are marked as dirty (filled with 1), meaning that
the entries are in need of a reset via ff_clean_intra_table_entries();
but actually, the entries are initialized to the state that
ff_clean_intra_table_entries() produces, so they can be marked
as non-dirty (i.e. filled with 0).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

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

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index ae0c847aa4..df2c130a16 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -361,9 +361,8 @@ av_cold int ff_mpv_init_context_frame(MpegEncContext *s)
     // Note the + 1 is for a quicker MPEG-4 slice_end detection
     if (!(s->mbskip_table  = av_mallocz(mb_array_size + 2)) ||
         /* which mb is an intra block,  init macroblock skip table */
-        !(s->mbintra_table = av_malloc(mb_array_size)))
+        !(s->mbintra_table = av_mallocz(mb_array_size)))
         return AVERROR(ENOMEM);
-    memset(s->mbintra_table, 1, mb_array_size);
 
     ALLOC_POOL(qscale_table, mv_table_size, 0);
     ALLOC_POOL(mb_type, mv_table_size * sizeof(uint32_t), 0);



More information about the ffmpeg-cvslog mailing list