]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/bink.c
lavf/movenc: fix invalid free with timecode meta and tmcd data copy.
[ffmpeg] / libavformat / bink.c
index beceffd88d0f2a4d3bbf50eb1535c4a09a1cd49c..5eb22111f0c6d34b9c73fee6fb156be817b550ae 100644 (file)
@@ -68,7 +68,7 @@ static int probe(AVProbeData *p)
     return 0;
 }
 
-static int read_header(AVFormatContext *s, AVFormatParameters *ap)
+static int read_header(AVFormatContext *s)
 {
     BinkDemuxContext *bink = s->priv_data;
     AVIOContext *pb = s->pb;
@@ -115,6 +115,8 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
     vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     vst->codec->codec_id   = CODEC_ID_BINKVIDEO;
     vst->codec->extradata  = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
+    if (!vst->codec->extradata)
+        return AVERROR(ENOMEM);
     vst->codec->extradata_size = 4;
     avio_read(pb, vst->codec->extradata, 4);