Mesa (master): frontends/omx: fix build warning

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 23:50:43 UTC 2021


Module: Mesa
Branch: master
Commit: c53a886ba86546ea14866c7c9a4d3ea25e8c39ff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c53a886ba86546ea14866c7c9a4d3ea25e8c39ff

Author: Leo Liu <leo.liu at amd.com>
Date:   Sun Jan 10 11:15:38 2021 -0500

frontends/omx: fix build warning

>From code path, it's easy to see that the variable is only used
with condition, and the variable gets initialized with the same
condition before getting used, but we can initialize it when defined
to avoid the warning.

Signed-off-by: Leo Liu <leo.liu at amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8404>

---

 src/gallium/frontends/omx/bellagio/vid_dec_av1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/frontends/omx/bellagio/vid_dec_av1.c b/src/gallium/frontends/omx/bellagio/vid_dec_av1.c
index 3ee93313652..061eebcf7cf 100644
--- a/src/gallium/frontends/omx/bellagio/vid_dec_av1.c
+++ b/src/gallium/frontends/omx/bellagio/vid_dec_av1.c
@@ -169,7 +169,7 @@ static void sequence_header_obu(vid_dec_PrivateType *priv, struct vl_vlc *vlc)
       seq->decoder_model_present_for_this_op[0] = 0;
       initial_display_delay_present_for_this_op = 0;
    } else {
-      uint8_t buffer_delay_length_minus_1;
+      uint8_t buffer_delay_length_minus_1 = 0;
 
       timing_info_present_flag = av1_f(vlc, 1);
       if (timing_info_present_flag) {
@@ -1425,7 +1425,7 @@ static void frame_header_obu(vid_dec_PrivateType *priv, struct vl_vlc *vlc)
 {
    struct av1_sequence_header_obu *seq = &(priv->codec_data.av1.seq);
    struct av1_uncompressed_header_obu *hdr = &(priv->codec_data.av1.uncompressed_header);
-   unsigned idLen;
+   unsigned idLen = 0;
    unsigned allFrames;
    int i, j;
 



More information about the mesa-commit mailing list