diff mbox series

[FFmpeg-devel,17/22] avcodec/dovi_rpudec: sanitize DM data before decoding

Message ID 20240728102527.17991-17-ffmpeg@haasn.xyz
State New
Headers show
Series [FFmpeg-devel,01/22] avutil/dovi_meta: document static vs dynamic ext blocks | expand

Checks

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

Commit Message

Niklas Haas July 28, 2024, 10:25 a.m. UTC
From: Niklas Haas <git@haasn.dev>

Some DM types do not fill the whole struct, so just clear it entirely
before going filling the decoded values.
---
 libavcodec/dovi_rpudec.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c
index 91c9e41926..9f295d4fe4 100644
--- a/libavcodec/dovi_rpudec.c
+++ b/libavcodec/dovi_rpudec.c
@@ -323,6 +323,7 @@  static int parse_ext_blocks(DOVIContext *s, GetBitContext *gb, int ver,
             dm = &ext->dm_dynamic[ext->num_dynamic++];
         }
 
+        memset(dm, 0, sizeof(*dm));
         dm->level = level;
         switch (ver) {
         case 1: ret = parse_ext_v1(s, gb, dm); break;