diff mbox series

[FFmpeg-devel,7/9] avcodec/vvc/mvs: Initialize mvf

Message ID 20240519024915.1944150-7-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/9] avcodec/vqcdec: Check init_get_bits8() for failure | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer May 19, 2024, 2:49 a.m. UTC
This might not be needed for correctness but it could
help general reproducability of issues

Related to: CID1560037 Uninitialized scalar variable
Related to: CID1560044 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/vvc/mvs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Nuo Mi May 19, 2024, 2:28 p.m. UTC | #1
On Sun, May 19, 2024 at 10:50 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:

> This might not be needed for correctness but it could
> help general reproducability of issues
>
> Related to: CID1560037 Uninitialized scalar variable
> Related to: CID1560044 Uninitialized scalar variable
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/vvc/mvs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/vvc/mvs.c b/libavcodec/vvc/mvs.c
> index fe7d9234603..521cf96a896 100644
> --- a/libavcodec/vvc/mvs.c
> +++ b/libavcodec/vvc/mvs.c
> @@ -411,7 +411,7 @@ void ff_vvc_store_sb_mvs(const VVCLocalContext *lc,
> PredictionUnit *pu)
>      const int sbw = cu->cb_width / mi->num_sb_x;
>      const int sbh = cu->cb_height / mi->num_sb_y;
>      SubblockParams params[2];
> -    MvField mvf;
> +    MvField mvf = {0};
>
>      mvf.pred_flag = mi->pred_flag;
>      mvf.bcw_idx = mi->bcw_idx;
> @@ -504,7 +504,7 @@ void ff_vvc_store_mvf(const VVCLocalContext *lc, const
> MvField *mvf)
>  void ff_vvc_store_mv(const VVCLocalContext *lc, const MotionInfo *mi)
>  {
>      const CodingUnit *cu = lc->cu;
> -    MvField mvf;
> +    MvField mvf = {0};
>
>      mvf.hpel_if_idx = mi->hpel_if_idx;
>      mvf.bcw_idx = mi->bcw_idx;
> --
> 2.45.1
>
both  "mvf.ciip_flag = 0" are not needed if we set mvf to 0

>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
Michael Niedermayer May 19, 2024, 7:40 p.m. UTC | #2
On Sun, May 19, 2024 at 10:28:49PM +0800, Nuo Mi wrote:
> On Sun, May 19, 2024 at 10:50 AM Michael Niedermayer <michael@niedermayer.cc>
> wrote:
> 
> > This might not be needed for correctness but it could
> > help general reproducability of issues
> >
> > Related to: CID1560037 Uninitialized scalar variable
> > Related to: CID1560044 Uninitialized scalar variable
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/vvc/mvs.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/vvc/mvs.c b/libavcodec/vvc/mvs.c
> > index fe7d9234603..521cf96a896 100644
> > --- a/libavcodec/vvc/mvs.c
> > +++ b/libavcodec/vvc/mvs.c
> > @@ -411,7 +411,7 @@ void ff_vvc_store_sb_mvs(const VVCLocalContext *lc,
> > PredictionUnit *pu)
> >      const int sbw = cu->cb_width / mi->num_sb_x;
> >      const int sbh = cu->cb_height / mi->num_sb_y;
> >      SubblockParams params[2];
> > -    MvField mvf;
> > +    MvField mvf = {0};
> >
> >      mvf.pred_flag = mi->pred_flag;
> >      mvf.bcw_idx = mi->bcw_idx;
> > @@ -504,7 +504,7 @@ void ff_vvc_store_mvf(const VVCLocalContext *lc, const
> > MvField *mvf)
> >  void ff_vvc_store_mv(const VVCLocalContext *lc, const MotionInfo *mi)
> >  {
> >      const CodingUnit *cu = lc->cu;
> > -    MvField mvf;
> > +    MvField mvf = {0};
> >
> >      mvf.hpel_if_idx = mi->hpel_if_idx;
> >      mvf.bcw_idx = mi->bcw_idx;
> > --
> > 2.45.1
> >
> both  "mvf.ciip_flag = 0" are not needed if we set mvf to 0

locally changed

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/vvc/mvs.c b/libavcodec/vvc/mvs.c
index fe7d9234603..521cf96a896 100644
--- a/libavcodec/vvc/mvs.c
+++ b/libavcodec/vvc/mvs.c
@@ -411,7 +411,7 @@  void ff_vvc_store_sb_mvs(const VVCLocalContext *lc, PredictionUnit *pu)
     const int sbw = cu->cb_width / mi->num_sb_x;
     const int sbh = cu->cb_height / mi->num_sb_y;
     SubblockParams params[2];
-    MvField mvf;
+    MvField mvf = {0};
 
     mvf.pred_flag = mi->pred_flag;
     mvf.bcw_idx = mi->bcw_idx;
@@ -504,7 +504,7 @@  void ff_vvc_store_mvf(const VVCLocalContext *lc, const MvField *mvf)
 void ff_vvc_store_mv(const VVCLocalContext *lc, const MotionInfo *mi)
 {
     const CodingUnit *cu = lc->cu;
-    MvField mvf;
+    MvField mvf = {0};
 
     mvf.hpel_if_idx = mi->hpel_if_idx;
     mvf.bcw_idx = mi->bcw_idx;