diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-10-03 18:25:35 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-10-03 18:25:35 +0100 |
commit | eedefc9f6bd19f1c86b43d1fcc31a203b4ecea10 (patch) | |
tree | 42a5919a6e5587c280b75839a5d06d58d04dbf3b | |
parent | e5e78379ad8287cd2b71b4cdb743e905c8cd0369 (diff) |
avcodecmap: Don't allocate dummy codec data anymore, it causes crashes nowadays
Multithreaded encoders are going to free this dummy codec data twice, e.g.
with this pipeline
gst-launch-1.0 videotestsrc num-buffers=40 ! \
videoconvert ! avenc_mjpeg ! fakesink
-rw-r--r-- | ext/libav/gstavcodecmap.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c index 23bf04e..126919e 100644 --- a/ext/libav/gstavcodecmap.c +++ b/ext/libav/gstavcodecmap.c @@ -2967,12 +2967,8 @@ gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id, GST_DEBUG ("have codec data of size %" G_GSIZE_FORMAT, map.size); gst_buffer_unmap (buf, &map); - } else if (context->extradata == NULL && codec_id != AV_CODEC_ID_AAC_LATM && - codec_id != AV_CODEC_ID_FLAC) { - /* no extradata, alloc dummy with 0 sized, some codecs insist on reading - * extradata anyway which makes then segfault. */ - context->extradata = - av_mallocz (GST_ROUND_UP_16 (FF_INPUT_BUFFER_PADDING_SIZE)); + } else { + context->extradata = NULL; context->extradata_size = 0; GST_DEBUG ("no codec data"); } |