wtv: Mark attachment with a negative stream id
authorLuca Barbato <lu_zero@gentoo.org>
Mon, 24 Jun 2013 16:12:24 +0000 (18:12 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sun, 7 Jul 2013 02:28:51 +0000 (04:28 +0200)
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
libavformat/wtv.c

index 23b662d..8b92746 100644 (file)
@@ -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;