[FFmpeg-cvslog] wtvdec: Check that stream private context has been allocated before use.

Michael Niedermayer git at videolan.org
Sun Apr 22 16:00:31 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Apr 22 15:29:34 2012 +0200| [fd2127ad53370c4f5d615265c4f915126e7d5f4f] | committer: Michael Niedermayer

wtvdec: Check that stream private context has been allocated before use.

This fixes a null ptr dereference with attachments

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/wtvdec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index a2a26c2..e25bb5f 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -833,7 +833,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
             }
         } else if (!ff_guidcmp(g, ff_data_guid)) {
             int stream_index = ff_find_stream_index(s, sid);
-            if (mode == SEEK_TO_DATA && stream_index >= 0 && len > 32) {
+            if (mode == SEEK_TO_DATA && stream_index >= 0 && len > 32 && s->streams[stream_index]->priv_data) {
                 WtvStream *wst = s->streams[stream_index]->priv_data;
                 wst->seen_data = 1;
                 if (len_ptr) {



More information about the ffmpeg-cvslog mailing list