[FFmpeg-cvslog] yop: check return value of avformat_new_stream()

Paul B Mahol git at videolan.org
Thu Oct 25 21:29:17 CEST 2012


ffmpeg | branch: release/0.10 | Paul B Mahol <onemda at gmail.com> | Fri Oct 12 14:23:01 2012 +0000| [46c1e5de58ac8cbe0f222e2649cf6bd6dd768012] | committer: Michael Niedermayer

yop: check return value of avformat_new_stream()

Fixes null pointer dereference, fixes CID703729.

Signed-off-by: Paul B Mahol <onemda at gmail.com>
(cherry picked from commit 3d179edf6d2a987e7eb134eea541954338a19add)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46c1e5de58ac8cbe0f222e2649cf6bd6dd768012
---

 libavformat/yop.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/yop.c b/libavformat/yop.c
index eac3fb6..9c06404 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;



More information about the ffmpeg-cvslog mailing list