diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-22 17:29:34 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-22 17:29:34 +0400 |
commit | fd2127ad53370c4f5d615265c4f915126e7d5f4f (patch) | |
tree | 38618656bb013339337f72ff06e07de5bf93085d /libavformat/wtvdec.c | |
parent | 9a4f5b76169a71156819dbaa8ee0b6ea25dc7195 (diff) |
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@gmx.at>
Diffstat (limited to 'libavformat/wtvdec.c')
-rw-r--r-- | libavformat/wtvdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index a2a26c2ccb..e25bb5ff54 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) { |