summaryrefslogtreecommitdiff
path: root/libavcodec/h264dec.c
diff options
context:
space:
mode:
authorZhao Zhili <quinkblack@foxmail.com>2018-09-06 17:15:11 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2018-09-07 20:35:54 +0200
commitb9d1f5bf68111772e552421d21a32b0d61718899 (patch)
treefdfbf7c993f0e14e04e0f7b5f1dcc5b52386a370 /libavcodec/h264dec.c
parent9f60c58586805cc5249ea0446a9bb86eed8bc311 (diff)
avcodec/h264dec: check number of SPS in is_extra
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/h264dec.c')
-rw-r--r--libavcodec/h264dec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 8d115fa040..1f44ed18d9 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -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)