diff mbox series

[FFmpeg-devel,3/6] avcodec/vvc/refs: Use unsigned mask

Message ID 20240707184729.3525852-3-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/6] avcodec/tiff: Check value on positive signed targets | expand

Checks

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

Commit Message

Michael Niedermayer July 7, 2024, 6:47 p.m. UTC
Not a bugfix, but might fix CID1604361 Overflowed constant

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

Comments

Nuo Mi July 8, 2024, 1:49 p.m. UTC | #1
LGTM.
Thank you, Michael,


On Mon, Jul 8, 2024 at 2:48 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:

> Not a bugfix, but might fix CID1604361 Overflowed constant
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/vvc/refs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/vvc/refs.c b/libavcodec/vvc/refs.c
> index 26a5b0b34cc..c1fc6132c2e 100644
> --- a/libavcodec/vvc/refs.c
> +++ b/libavcodec/vvc/refs.c
> @@ -310,7 +310,7 @@ void ff_vvc_bump_frame(VVCContext *s, VVCFrameContext
> *fc)
>
>  static VVCFrame *find_ref_idx(VVCContext *s, VVCFrameContext *fc, int
> poc, uint8_t use_msb)
>  {
> -    const int mask = use_msb ? ~0 : fc->ps.sps->max_pic_order_cnt_lsb - 1;
> +    const unsigned mask = use_msb ? ~0 :
> fc->ps.sps->max_pic_order_cnt_lsb - 1;
>
>      for (int i = 0; i < FF_ARRAY_ELEMS(fc->DPB); i++) {
>          VVCFrame *ref = &fc->DPB[i];
> --
> 2.45.2
>
> _______________________________________________
> 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 July 9, 2024, 12:59 p.m. UTC | #2
On Mon, Jul 08, 2024 at 09:49:25PM +0800, Nuo Mi wrote:
> LGTM.
> Thank you, Michael,

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/vvc/refs.c b/libavcodec/vvc/refs.c
index 26a5b0b34cc..c1fc6132c2e 100644
--- a/libavcodec/vvc/refs.c
+++ b/libavcodec/vvc/refs.c
@@ -310,7 +310,7 @@  void ff_vvc_bump_frame(VVCContext *s, VVCFrameContext *fc)
 
 static VVCFrame *find_ref_idx(VVCContext *s, VVCFrameContext *fc, int poc, uint8_t use_msb)
 {
-    const int mask = use_msb ? ~0 : fc->ps.sps->max_pic_order_cnt_lsb - 1;
+    const unsigned mask = use_msb ? ~0 : fc->ps.sps->max_pic_order_cnt_lsb - 1;
 
     for (int i = 0; i < FF_ARRAY_ELEMS(fc->DPB); i++) {
         VVCFrame *ref = &fc->DPB[i];