diff mbox series

[FFmpeg-devel,7/7] avcodec/tests/bitstream_template: Make it clear that the return is intentionally not checked

Message ID 20240523011758.2434580-7-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/7] avdevice/pulse_audio_enc: Use av_rescale() to avoid integer overflow | 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 23, 2024, 1:17 a.m. UTC
Helps: CID1518967 Unchecked return value
Helps: CID1518968 Unchecked return value

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

Comments

Andreas Rheinhardt May 23, 2024, 8:22 a.m. UTC | #1
Michael Niedermayer:
> Helps: CID1518967 Unchecked return value
> Helps: CID1518968 Unchecked return value
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/tests/bitstream_template.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/tests/bitstream_template.c b/libavcodec/tests/bitstream_template.c
> index ef59845154d..d8cf980bee1 100644
> --- a/libavcodec/tests/bitstream_template.c
> +++ b/libavcodec/tests/bitstream_template.c
> @@ -74,7 +74,7 @@ int main(int argc, char **argv)
>      for (unsigned i = 0; i < SIZE; i++)
>          buf[i] = av_lfg_get(&lfg);
>  
> -    bits_init8   (&bc, buf, SIZE);
> +    (void)bits_init8   (&bc, buf, SIZE);
>      init_put_bits(&pb, dst, SIZE);
>  
>      /* use a random sequence of bitreading operations to transfer data

Test tools should actually test.

- Andreas
Michael Niedermayer May 24, 2024, 1:11 a.m. UTC | #2
On Thu, May 23, 2024 at 10:22:56AM +0200, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > Helps: CID1518967 Unchecked return value
> > Helps: CID1518968 Unchecked return value
> > 
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/tests/bitstream_template.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/tests/bitstream_template.c b/libavcodec/tests/bitstream_template.c
> > index ef59845154d..d8cf980bee1 100644
> > --- a/libavcodec/tests/bitstream_template.c
> > +++ b/libavcodec/tests/bitstream_template.c
> > @@ -74,7 +74,7 @@ int main(int argc, char **argv)
> >      for (unsigned i = 0; i < SIZE; i++)
> >          buf[i] = av_lfg_get(&lfg);
> >  
> > -    bits_init8   (&bc, buf, SIZE);
> > +    (void)bits_init8   (&bc, buf, SIZE);
> >      init_put_bits(&pb, dst, SIZE);
> >  
> >      /* use a random sequence of bitreading operations to transfer data
> 
> Test tools should actually test.

will replace with a assert0() then

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/tests/bitstream_template.c b/libavcodec/tests/bitstream_template.c
index ef59845154d..d8cf980bee1 100644
--- a/libavcodec/tests/bitstream_template.c
+++ b/libavcodec/tests/bitstream_template.c
@@ -74,7 +74,7 @@  int main(int argc, char **argv)
     for (unsigned i = 0; i < SIZE; i++)
         buf[i] = av_lfg_get(&lfg);
 
-    bits_init8   (&bc, buf, SIZE);
+    (void)bits_init8   (&bc, buf, SIZE);
     init_put_bits(&pb, dst, SIZE);
 
     /* use a random sequence of bitreading operations to transfer data