From 46ad68084e4b1bb1c8f822a7252ce7351a17bac7 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 3 May 2024 22:28:16 +0200 Subject: [PATCH] avcodec/dovi_rpuenc: initialize profile Code is taken from dovi_rpudec Fixes: CID1596604 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/dovi_rpuenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/dovi_rpuenc.c b/libavcodec/dovi_rpuenc.c index ad03e143ee..5a482a7a6e 100644 --- a/libavcodec/dovi_rpuenc.c +++ b/libavcodec/dovi_rpuenc.c @@ -565,6 +565,8 @@ int ff_dovi_rpu_generate(DOVIContext *s, const AVDOVIMetadata *metadata, set_ue_golomb(pb, vdr_rpu_id); s->mapping = &s->vdr[vdr_rpu_id]->mapping; + profile = s->cfg.dv_profile ? s->cfg.dv_profile : ff_dovi_guess_profile_hevc(hdr); + if (!use_prev_vdr_rpu) { set_ue_golomb(pb, mapping->mapping_color_space); set_ue_golomb(pb, mapping->mapping_chroma_format_idc);