diff mbox series

[FFmpeg-devel,4/7] avcodec/bonk: actual_run seems not able to become negative

Message ID 20221106123430.1668-4-michael@niedermayer.cc
State Accepted
Commit 5df8c300a915cd0fa1f337ce36957624593928df
Headers show
Series [FFmpeg-devel,1/7] avcodec/bonk: Use unsigned in predictor_calc_error() to avoid undefined overflows | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer Nov. 6, 2022, 12:34 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/bonk.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Paul B Mahol Nov. 6, 2022, 6:27 p.m. UTC | #1
On 11/6/22, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/bonk.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c
> index fca8c246aa..99dac0b951 100644
> --- a/libavcodec/bonk.c
> +++ b/libavcodec/bonk.c
> @@ -184,8 +184,7 @@ static int intlist_read(BonkContext *s, int *buf, int
> entries, int base_2_part)
>          } else if (steplet > 0) {
>              int actual_run = read_uint_max(s, steplet - 1);
>
> -            if (actual_run < 0)
> -                break;
> +            av_assert0(actual_run >= 0);
>
>              if (actual_run > 0) {
>                  bits[x  ].bit   = dominant;
> --
> 2.17.1
>

Not sure, at your risk.

> _______________________________________________
> 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".
>
diff mbox series

Patch

diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c
index fca8c246aa..99dac0b951 100644
--- a/libavcodec/bonk.c
+++ b/libavcodec/bonk.c
@@ -184,8 +184,7 @@  static int intlist_read(BonkContext *s, int *buf, int entries, int base_2_part)
         } else if (steplet > 0) {
             int actual_run = read_uint_max(s, steplet - 1);
 
-            if (actual_run < 0)
-                break;
+            av_assert0(actual_run >= 0);
 
             if (actual_run > 0) {
                 bits[x  ].bit   = dominant;