Browse Source

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
tags/n2.0
Luca Barbato 12 years ago
parent
commit
f5e646a00a
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavformat/wtv.c

+ 1
- 0
libavformat/wtv.c 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;


Loading…
Cancel
Save