diff mbox series

[FFmpeg-devel,v2,9/9] avcodec/huffyuvdec: Use assert to check for things that can't fail

Message ID GV1P250MB0737BBB68AB1C9B27FE78C718F3C2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Headers show
Series [FFmpeg-devel,1/6] avcodec/huffyuvdec: Don't zero unnecessarily | expand

Checks

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

Commit Message

Andreas Rheinhardt April 4, 2024, 7:33 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/huffyuvdec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index e35d55c8ad..a8ccb724f5 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -290,13 +290,13 @@  static int read_old_huffman_tables(HYuvDecContext *s)
 
     bytestream2_init(&gb, classic_shift_luma,
                      sizeof(classic_shift_luma));
-    if ((ret = read_len_table(s->len[0], &gb, 256)) < 0)
-        return ret;
+    ret = read_len_table(s->len[0], &gb, 256);
+    av_assert1(ret >= 0);
 
     bytestream2_init(&gb, classic_shift_chroma,
                      sizeof(classic_shift_chroma));
-    if ((ret = read_len_table(s->len[1], &gb, 256)) < 0)
-        return ret;
+    ret = read_len_table(s->len[1], &gb, 256);
+    av_assert1(ret >= 0);
 
     for (i = 0; i < 256; i++)
         s->bits[0][i] = classic_add_luma[i];