mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
avaudenc: Avoid double-freeing frame's extended data
This occured when attempting to encode 16 channel audio, would crash on the first buffer. We only need to store ext_data, old ext_data_array (frame->extended_data) is already freed by `av_frame_unref`. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6359>
This commit is contained in:
parent
a53ea3c61c
commit
55136c30c4
1 changed files with 2 additions and 3 deletions
|
@ -403,7 +403,7 @@ typedef struct
|
|||
GstBuffer *buffer;
|
||||
GstMapInfo map;
|
||||
|
||||
guint8 **ext_data_array, *ext_data;
|
||||
guint8 *ext_data;
|
||||
} BufferInfo;
|
||||
|
||||
static void
|
||||
|
@ -416,7 +416,6 @@ buffer_info_free (void *opaque, guint8 * data)
|
|||
gst_buffer_unref (info->buffer);
|
||||
} else {
|
||||
av_freep (&info->ext_data);
|
||||
av_freep (&info->ext_data_array);
|
||||
}
|
||||
g_free (info);
|
||||
}
|
||||
|
@ -473,7 +472,7 @@ gst_ffmpegaudenc_send_frame (GstFFMpegAudEnc * ffmpegaudenc, GstBuffer * buffer)
|
|||
av_buffer_create (NULL, 0, buffer_info_free, buffer_info, 0);
|
||||
|
||||
if (info->channels > AV_NUM_DATA_POINTERS) {
|
||||
buffer_info->ext_data_array = frame->extended_data =
|
||||
frame->extended_data =
|
||||
av_malloc_array (info->channels, sizeof (uint8_t *));
|
||||
} else {
|
||||
frame->extended_data = frame->data;
|
||||
|
|
Loading…
Reference in a new issue