1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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
This commit is contained in:
Luca Barbato 2013-06-24 18:12:24 +02:00
parent a4baf96abd
commit f5e646a00a

View 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;