summaryrefslogtreecommitdiff
path: root/libavformat/wtv.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-24 18:12:24 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-07 04:28:51 +0200
commitf5e646a00ac21e500dae4bcceded790a0fbc5246 (patch)
tree17cfa9e95bfba333ba3eba919653f2e138647826 /libavformat/wtv.c
parenta4baf96abd64cda68e3e4692b182bdf60745a14d (diff)
wtv: Mark attachment with a negative stream id
A sid 0 would be mismatched to the attachment. Prevent NULL pointer dereference. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavformat/wtv.c')
-rw-r--r--libavformat/wtv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/wtv.c b/libavformat/wtv.c
index 23b662d871..8b927466cf 100644
--- a/libavformat/wtv.c
+++ b/libavformat/wtv.c
@@ -472,6 +472,7 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
st->codec->codec_id = AV_CODEC_ID_MJPEG;
st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
st->codec->extradata = av_mallocz(filesize);
+ st->id = -1;
if (!st->codec->extradata)
goto done;
st->codec->extradata_size = filesize;