aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-10-12 14:23:01 +0000
committerMichael Niedermayer <michaelni@gmx.at>2012-10-25 21:09:40 +0200
commit46c1e5de58ac8cbe0f222e2649cf6bd6dd768012 (patch)
treee7d893eb5e58842acf2ebe443b9c84a991052934
parente6dfaf7bb89a63546c2266f5bc1f56719394ab91 (diff)
downloadffmpeg-46c1e5de58ac8cbe0f222e2649cf6bd6dd768012.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> (cherry picked from commit 3d179edf6d2a987e7eb134eea541954338a19add) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/yop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/yop.c b/libavformat/yop.c
index eac3fb6707..9c06404698 100644
--- a/libavformat/yop.c
+++ b/libavformat/yop.c
@@ -59,6 +59,8 @@ static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap)
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;