diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-10-12 18:23:01 +0400 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-10-12 18:25:00 +0400 |
commit | 3d179edf6d2a987e7eb134eea541954338a19add (patch) | |
tree | 308e837d2127b067d59a12c9e8b239dd59a2cbb4 /libavformat | |
parent | a9bd51b1e647d7ec0b7661e19b87ade86098b38c (diff) |
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')
-rw-r--r-- | libavformat/yop.c | 2 |
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; |