[FFmpeg-cvslog] yop: check return value of avformat_new_stream()
Paul B Mahol
git at videolan.org
Fri Oct 12 16:27:51 CEST 2012
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Oct 12 14:23:01 2012 +0000| [3d179edf6d2a987e7eb134eea541954338a19add] | committer: Paul B Mahol
yop: check return value of avformat_new_stream()
Fixes null pointer dereference, fixes CID703729.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d179edf6d2a987e7eb134eea541954338a19add
---
libavformat/yop.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/yop.c b/libavformat/yop.c
index 1185a3e..2d89c6e 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;
More information about the ffmpeg-cvslog
mailing list