mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-25 16:21:13 +00:00
h264: ff_h264_decode_extradata: check buffer args
The buffer size and pointer were not checked prior to testing the first
byte of the buffer. These were sometimes checked before calling, but it is
better to add it inside the function as it takes buf and size arguments.
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
(cherry picked from commit 715f259bf9
)
This commit is contained in:
parent
02affe2f0e
commit
7aa24b157d
@ -1022,6 +1022,9 @@ int ff_h264_decode_extradata(H264Context *h, const uint8_t *buf, int size)
|
||||
{
|
||||
AVCodecContext *avctx = h->s.avctx;
|
||||
|
||||
if(!buf || size <= 0)
|
||||
return -1;
|
||||
|
||||
if(buf[0] == 1){
|
||||
int i, cnt, nalsize;
|
||||
const unsigned char *p = buf;
|
||||
|
Loading…
Reference in New Issue
Block a user