diff mbox series

[FFmpeg-devel] cbs_h265: Fix use of an uninitialized variable

Message ID 20200521080609.6790-1-martin@martin.st
State Accepted
Commit 1f7c8d319b72df1bb01b459e9cb40662c061f7df
Headers show
Series [FFmpeg-devel] cbs_h265: Fix use of an uninitialized variable | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Martin Storsjö May 21, 2020, 8:06 a.m. UTC
This fixes test failures in fate-cbs-hevc-* in certain configurations
since c53f9f436440be4e18.
---
Not sure if this is what was intended, but the current code doesn't
work at least.
---
 libavcodec/cbs_h265_syntax_template.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer May 22, 2020, 5:18 p.m. UTC | #1
On 5/21/2020 5:06 AM, Martin Storsjö wrote:
> This fixes test failures in fate-cbs-hevc-* in certain configurations
> since c53f9f436440be4e18.
> ---
> Not sure if this is what was intended, but the current code doesn't
> work at least.
> ---
>  libavcodec/cbs_h265_syntax_template.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c
> index 55da1a0a11..a3c1d1c7ca 100644
> --- a/libavcodec/cbs_h265_syntax_template.c
> +++ b/libavcodec/cbs_h265_syntax_template.c
> @@ -552,7 +552,7 @@ static int FUNC(st_ref_pic_set)(CodedBitstreamContext *ctx, RWContext *rw,
>                  flags(use_delta_flag[j], 1, j);
>              else
>                  infer(use_delta_flag[j], 1);
> -            if (current->use_delta_flag[i])
> +            if (current->use_delta_flag[j])

LGTM

>                  ++num_ref_pics;
>          }
>          if (num_ref_pics >= HEVC_MAX_DPB_SIZE) {
>
diff mbox series

Patch

diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c
index 55da1a0a11..a3c1d1c7ca 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -552,7 +552,7 @@  static int FUNC(st_ref_pic_set)(CodedBitstreamContext *ctx, RWContext *rw,
                 flags(use_delta_flag[j], 1, j);
             else
                 infer(use_delta_flag[j], 1);
-            if (current->use_delta_flag[i])
+            if (current->use_delta_flag[j])
                 ++num_ref_pics;
         }
         if (num_ref_pics >= HEVC_MAX_DPB_SIZE) {