mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
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
This commit is contained in:
parent
e5e78379ad
commit
eedefc9f6b
1 changed files with 2 additions and 6 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue