Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Strasser <eclipse7@gmx.net>2011-09-24 20:00:16 +0400
committerAlexander Strasser <eclipse7@gmx.net>2011-09-25 19:16:44 +0400
commit715f259bf949b06df1b5ed0307606dc258754c99 (patch)
treeb0fd62aa9d4d5a3baf5c5a7f96e9116471b58cac /libavcodec/h264.c
parent424bcc46b5fb0d662e0fb9ad6319c5b9ef3d770f (diff)
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>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index ec5a46409a..1924f364b6 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -995,6 +995,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;