diff mbox series

[FFmpeg-devel,v2,1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value

Message ID 20231228031042.1129-1-tong1.wu@intel.com
State New
Headers show
Series [FFmpeg-devel,v2,1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value | 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

Wu, Tong1 Dec. 28, 2023, 3:10 a.m. UTC
Previous max_num_refs was based on pp.frame_refs plus 1 and it could possibly
reaches the size limit. Actually it should be the size of pp.ref_frame_map
plus 1.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
---
 libavcodec/d3d12va_vp9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Xiang, Haihao Jan. 2, 2024, 5:21 a.m. UTC | #1
On Do, 2023-12-28 at 11:10 +0800, Tong Wu wrote:
> Previous max_num_refs was based on pp.frame_refs plus 1 and it could possibly
> reaches the size limit. Actually it should be the size of pp.ref_frame_map
> plus 1.
> 
> Signed-off-by: Tong Wu <tong1.wu@intel.com>
> ---
>  libavcodec/d3d12va_vp9.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c
> index bb94e18781..d6dfc905d9 100644
> --- a/libavcodec/d3d12va_vp9.c
> +++ b/libavcodec/d3d12va_vp9.c
> @@ -148,7 +148,7 @@ static int d3d12va_vp9_decode_init(AVCodecContext *avctx)
>          break;
>      };
>  
> -    ctx->max_num_ref = FF_ARRAY_ELEMS(pp.frame_refs) + 1;
> +    ctx->max_num_ref = FF_ARRAY_ELEMS(pp.ref_frame_map) + 1;
>  
>      return ff_d3d12va_decode_init(avctx);
>  }

LGTM, will apply if there are no objections

Thanks
Haihao
Xiang, Haihao Jan. 5, 2024, 3:56 a.m. UTC | #2
On Di, 2024-01-02 at 05:21 +0000, Xiang, Haihao wrote:
> On Do, 2023-12-28 at 11:10 +0800, Tong Wu wrote:
> > Previous max_num_refs was based on pp.frame_refs plus 1 and it could
> > possibly
> > reaches the size limit. Actually it should be the size of pp.ref_frame_map
> > plus 1.
> > 
> > Signed-off-by: Tong Wu <tong1.wu@intel.com>
> > ---
> >  libavcodec/d3d12va_vp9.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c
> > index bb94e18781..d6dfc905d9 100644
> > --- a/libavcodec/d3d12va_vp9.c
> > +++ b/libavcodec/d3d12va_vp9.c
> > @@ -148,7 +148,7 @@ static int d3d12va_vp9_decode_init(AVCodecContext
> > *avctx)
> >          break;
> >      };
> >  
> > -    ctx->max_num_ref = FF_ARRAY_ELEMS(pp.frame_refs) + 1;
> > +    ctx->max_num_ref = FF_ARRAY_ELEMS(pp.ref_frame_map) + 1;
> >  
> >      return ff_d3d12va_decode_init(avctx);
> >  }
> 
> LGTM, will apply if there are no objections

Pushed.
diff mbox series

Patch

diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c
index bb94e18781..d6dfc905d9 100644
--- a/libavcodec/d3d12va_vp9.c
+++ b/libavcodec/d3d12va_vp9.c
@@ -148,7 +148,7 @@  static int d3d12va_vp9_decode_init(AVCodecContext *avctx)
         break;
     };
 
-    ctx->max_num_ref = FF_ARRAY_ELEMS(pp.frame_refs) + 1;
+    ctx->max_num_ref = FF_ARRAY_ELEMS(pp.ref_frame_map) + 1;
 
     return ff_d3d12va_decode_init(avctx);
 }