diff mbox

[FFmpeg-devel] avcodec/h264dec: check number of SPS in is_extra

Message ID 20180906091511.4868-1-quinkblack@foxmail.com
State Accepted
Commit b9d1f5bf68111772e552421d21a32b0d61718899
Headers show

Commit Message

Zhao Zhili Sept. 6, 2018, 9:15 a.m. UTC
---
 libavcodec/h264dec.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Niedermayer Sept. 7, 2018, 6:34 p.m. UTC | #1
On Thu, Sep 06, 2018 at 05:15:11PM +0800, Zhao Zhili wrote:
> ---
>  libavcodec/h264dec.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index bffce52..6f7530d 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -871,6 +871,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)