[FFmpeg-cvslog] flvdec: check return value of create_stream()

Paul B Mahol git at videolan.org
Mon Oct 15 18:04:17 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Oct 15 15:59:53 2012 +0000| [d7d5b5dfc1b6f29646d2c1908c9bac8677f34256] | committer: Paul B Mahol

flvdec: check return value of create_stream()

Fixes null pointer dereference. Fixes CID732242.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

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

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 8c6807a..24302f6 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -730,6 +730,8 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
         av_log(s, AV_LOG_WARNING, "Stream discovered after head already parsed\n");
         st = create_stream(s,
              (int[]){AVMEDIA_TYPE_VIDEO, AVMEDIA_TYPE_AUDIO, AVMEDIA_TYPE_DATA}[stream_type]);
+        if (!st)
+            return AVERROR(ENOMEM);
 
     }
     av_dlog(s, "%d %X %d \n", stream_type, flags, st->discard);



More information about the ffmpeg-cvslog mailing list