]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/h264dec: check number of SPS in is_extra
authorZhao Zhili <quinkblack@foxmail.com>
Thu, 6 Sep 2018 09:15:11 +0000 (17:15 +0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 7 Sep 2018 18:35:54 +0000 (20:35 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/h264dec.c

index 8d115fa04039ec5d4e352d5374c516ea4da58917..1f44ed18d9c1fb273b00e614a3df5109af58a8dc 100644 (file)
@@ -855,6 +855,8 @@ static int is_extra(const uint8_t *buf, int buf_size)
 {
     int cnt= buf[5]&0x1f;
     const uint8_t *p= buf+6;
+    if (!cnt)
+        return 0;
     while(cnt--){
         int nalsize= AV_RB16(p) + 2;
         if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 7)