diff options
author | Luis de Bethencourt <luisbg@osg.samsung.com> | 2015-10-13 14:28:44 +0100 |
---|---|---|
committer | Luis de Bethencourt <luisbg@osg.samsung.com> | 2015-10-13 14:33:49 +0100 |
commit | 64124ef03574c39f936589a27eb854759b9f1222 (patch) | |
tree | b6498c08bc746188da17213560d4896897b10590 | |
parent | 4d1a6a0896ba25e8d88fca179222ae54d7e0efc8 (diff) | |
download | gst-libav-64124ef03574c39f936589a27eb854759b9f1222.tar.gz |
avviddec: only free config when pool doesn't take ownership
Since gst_buffer_pool_set_config() takes ownership of the config structure,
it is only necessary to free the structure before using it when the true
branch of if (gst_buffer_pool_config_validate_params) hasn't run.
gst_buffer_pool_set_config() always takes ownership of the structure
regardless of success or failure. Which means the return, checked with
if (!working_pool), has no relation to the state of the structure.
CID #1320708
-rw-r--r-- | ext/libav/gstavviddec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index c6c0d23..f139aee 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -1884,6 +1884,8 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query) if (gst_buffer_pool_config_validate_params (config, state->caps, size, min, max)) { working_pool = gst_buffer_pool_set_config (pool, config); + } else { + gst_structure_free (config); } if (!working_pool) { |