From 8f1d18a91be942ea646a3c074bee35c6046882af Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Thu, 5 Jan 2017 11:56:00 +0100
Subject: [PATCH] avcodec/bitstream: assert that *_size in ff_init_vlc_sparse()
 is valid

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/bitstream.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 562ca1cb823..8deaa4abb86 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -99,9 +99,11 @@ void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
     case 2:                                                 \
         v = *(const uint16_t *)ptr;                         \
         break;                                              \
-    default:                                                \
+    case 4:                                                 \
         v = *(const uint32_t *)ptr;                         \
         break;                                              \
+    default:                                                \
+        av_assert1(0);                                      \
     }                                                       \
 }
 
-- 
GitLab