diff mbox series

[FFmpeg-devel,1/9] avcodec/tiff: Assert init_get_bits8() success in horizontal_fill()

Message ID 20240518035743.766552-1-michael@niedermayer.cc
State Accepted
Commit 8814cedb079d5827e07a92e9424c2314bd0a6047
Headers show
Series [FFmpeg-devel,1/9] avcodec/tiff: Assert init_get_bits8() success in horizontal_fill() | expand

Checks

Context Check Description
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_fate_x86 success Make fate finished
yinshiyou/make_loongarch64 warning New warnings during build
andriy/make_x86 warning New warnings during build

Commit Message

Michael Niedermayer May 18, 2024, 3:57 a.m. UTC
Helps: CID1441167 Unchecked return value

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

Comments

Peter Ross May 18, 2024, 8:33 a.m. UTC | #1
On Sat, May 18, 2024 at 05:57:43AM +0200, Michael Niedermayer wrote:
> Fixes: CID1452425 Logically dead code
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/vp3.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
> index 09527607767..d03a1c9dbc1 100644
> --- a/libavcodec/vp3.c
> +++ b/libavcodec/vp3.c
> @@ -2001,8 +2001,7 @@ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int
>          x_offset = (-(x + 2) & 7) + 2;
>          y_offset = (-(y + 2) & 7) + 2;
>  
> -        if (x_offset > 8 + x_subpel && y_offset > 8 + y_subpel)
> -            return 0;
> +        av_assert1(!(x_offset > 8 + x_subpel && y_offset > 8 + y_subpel));
>  

ok

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
Ronald S. Bultje May 18, 2024, 3:07 p.m. UTC | #2
Hi,

On Fri, May 17, 2024 at 11:59 PM Michael Niedermayer <michael@niedermayer.cc>
wrote:

> Fixes: CID1507483 Unchecked return value
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/vp8.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
> index 19f32b34006..8e91613068a 100644
> --- a/libavcodec/vp8.c
> +++ b/libavcodec/vp8.c
> @@ -341,9 +341,8 @@ static int setup_partitions(VP8Context *s, const
> uint8_t *buf, int buf_size)
>      }
>
>      s->coeff_partition_size[i] = buf_size;
> -    ff_vpx_init_range_decoder(&s->coeff_partition[i], buf, buf_size);
>
> -    return 0;
> +    return ff_vpx_init_range_decoder(&s->coeff_partition[i], buf,
> buf_size);
>  }
>
>  static void vp7_get_quants(VP8Context *s)
> --
> 2.45.1
>

OK.

Ronald
Michael Niedermayer May 19, 2024, 7:43 p.m. UTC | #3
On Sat, May 18, 2024 at 11:07:15AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Fri, May 17, 2024 at 11:59 PM Michael Niedermayer <michael@niedermayer.cc>
> wrote:
> 
> > Fixes: CID1507483 Unchecked return value
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/vp8.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
> > index 19f32b34006..8e91613068a 100644
> > --- a/libavcodec/vp8.c
> > +++ b/libavcodec/vp8.c
> > @@ -341,9 +341,8 @@ static int setup_partitions(VP8Context *s, const
> > uint8_t *buf, int buf_size)
> >      }
> >
> >      s->coeff_partition_size[i] = buf_size;
> > -    ff_vpx_init_range_decoder(&s->coeff_partition[i], buf, buf_size);
> >
> > -    return 0;
> > +    return ff_vpx_init_range_decoder(&s->coeff_partition[i], buf,
> > buf_size);
> >  }
> >
> >  static void vp7_get_quants(VP8Context *s)
> > --
> > 2.45.1
> >
> 
> OK.

will apply

thx

[...]
Michael Niedermayer May 19, 2024, 7:44 p.m. UTC | #4
On Sat, May 18, 2024 at 06:33:12PM +1000, Peter Ross wrote:
> On Sat, May 18, 2024 at 05:57:43AM +0200, Michael Niedermayer wrote:
> > Fixes: CID1452425 Logically dead code
> > 
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/vp3.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
> > index 09527607767..d03a1c9dbc1 100644
> > --- a/libavcodec/vp3.c
> > +++ b/libavcodec/vp3.c
> > @@ -2001,8 +2001,7 @@ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int
> >          x_offset = (-(x + 2) & 7) + 2;
> >          y_offset = (-(y + 2) & 7) + 2;
> >  
> > -        if (x_offset > 8 + x_subpel && y_offset > 8 + y_subpel)
> > -            return 0;
> > +        av_assert1(!(x_offset > 8 + x_subpel && y_offset > 8 + y_subpel));
> >  
> 
> ok

will apply

thx

[...]
Michael Niedermayer May 27, 2024, 11:59 p.m. UTC | #5
On Sat, May 18, 2024 at 05:57:35AM +0200, Michael Niedermayer wrote:
> Helps: CID1441167 Unchecked return value
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/tiff.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

will apply the patches which have not been applied yet from this set

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 19301d9e490..ca7e9f6aba9 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -422,7 +422,8 @@  static void av_always_inline horizontal_fill(TiffContext *s,
             uint8_t shift = is_dng ? 0 : 16 - bpp;
             GetBitContext gb;
 
-            init_get_bits8(&gb, src, width);
+            int ret = init_get_bits8(&gb, src, width);
+            av_assert1(ret >= 0);
             for (int i = 0; i < s->width; i++) {
                 dst16[i] = get_bits(&gb, bpp) << shift;
             }