diff mbox series

[FFmpeg-devel,3/3] avcodec/webp: Replace never-true check by assert

Message ID 20201022145624.657457-3-andreas.rheinhardt@gmail.com
State Accepted
Commit 8b1bb4f38e0c0c083f1833ac9411fb1fa9d4764c
Headers show
Series [FFmpeg-devel,1/3] avcodec/webp: Use uint8_t for code lengths
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 22, 2020, 2:56 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/webp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 549d125dcc..6de6a5c036 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -329,8 +329,7 @@  static int read_huffman_code_normal(WebPContext *s, HuffReader *hc,
     int i, symbol, max_symbol, prev_code_len, ret;
     int num_codes = 4 + get_bits(&s->gb, 4);
 
-    if (num_codes > NUM_CODE_LENGTH_CODES)
-        return AVERROR_INVALIDDATA;
+    av_assert1(num_codes <= NUM_CODE_LENGTH_CODES);
 
     for (i = 0; i < num_codes; i++)
         code_length_code_lengths[code_length_code_order[i]] = get_bits(&s->gb, 3);