summaryrefslogtreecommitdiff
path: root/libavformat/yop.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-10-12 14:23:01 +0000
committerPaul B Mahol <onemda@gmail.com>2012-10-12 14:25:00 +0000
commit3d179edf6d2a987e7eb134eea541954338a19add (patch)
tree308e837d2127b067d59a12c9e8b239dd59a2cbb4 /libavformat/yop.c
parenta9bd51b1e647d7ec0b7661e19b87ade86098b38c (diff)
downloadffmpeg-3d179edf6d2a987e7eb134eea541954338a19add.tar.gz
yop: check return value of avformat_new_stream()
Fixes null pointer dereference, fixes CID703729. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/yop.c')
-rw-r--r--libavformat/yop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/yop.c b/libavformat/yop.c
index 1185a3efc7..2d89c6e3f2 100644
--- a/libavformat/yop.c
+++ b/libavformat/yop.c
@@ -64,6 +64,8 @@ static int yop_read_header(AVFormatContext *s)
audio_stream = avformat_new_stream(s, NULL);
video_stream = avformat_new_stream(s, NULL);
+ if (!audio_stream || !video_stream)
+ return AVERROR(ENOMEM);
// Extra data that will be passed to the decoder
video_stream->codec->extradata_size = 8;