[FFmpeg-devel] [PATCH 5/7] avcodec/bonk: step cannot become 0 without overflowing which is undefined

Michael Niedermayer michael at niedermayer.cc
Sun Nov 6 14:34:28 EET 2022


also the original reference code does not contain a 0 check

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/bonk.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c
index 99dac0b951..37ad7854b6 100644
--- a/libavcodec/bonk.c
+++ b/libavcodec/bonk.c
@@ -203,8 +203,6 @@ static int intlist_read(BonkContext *s, int *buf, int entries, int base_2_part)
         }
 
         if (step < 256) {
-            if (step == 0)
-                return AVERROR_INVALIDDATA;
             step = 65536 / step;
             dominant = !dominant;
         }
-- 
2.17.1



More information about the ffmpeg-devel mailing list