mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
avviddec: Fix bufferpool config double free by taking a copy as needed
Also free the config in two code paths where we leaked it before.
This commit is contained in:
parent
5d52dcf5ef
commit
dc4b9ef7e6
1 changed files with 7 additions and 2 deletions
|
@ -1835,10 +1835,13 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
|
|||
/* If we have videometa, we never have to copy */
|
||||
if (have_videometa && have_pool && have_alignment &&
|
||||
gst_ffmpegviddec_can_direct_render (ffmpegdec)) {
|
||||
gst_ffmpegvideodec_prepare_dr_pool (ffmpegdec, pool, &state->info, config);
|
||||
GstStructure *config_copy = gst_structure_copy (config);
|
||||
|
||||
gst_ffmpegvideodec_prepare_dr_pool (ffmpegdec, pool, &state->info,
|
||||
config_copy);
|
||||
|
||||
/* FIXME validate and retry */
|
||||
if (gst_buffer_pool_set_config (pool, config)) {
|
||||
if (gst_buffer_pool_set_config (pool, gst_structure_copy (config_copy))) {
|
||||
GstFlowReturn ret;
|
||||
GstBuffer *tmp;
|
||||
|
||||
|
@ -1863,6 +1866,7 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
|
|||
gst_object_unref (ffmpegdec->internal_pool);
|
||||
ffmpegdec->internal_pool = gst_object_ref (pool);
|
||||
ffmpegdec->pool_info = state->info;
|
||||
gst_structure_free (config);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
@ -1873,6 +1877,7 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
|
|||
update_pool = TRUE;
|
||||
gst_object_unref (pool);
|
||||
pool = gst_object_ref (ffmpegdec->internal_pool);
|
||||
gst_structure_free (config);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue