mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
nvdec: Fix possible null object unref
gst_query_get_n_allocation_pools > 0 does not guarantee that the N th internal array has GstBufferPool object. So users should check the returned GstBufferPool object from gst_query_parse_nth_allocation_pool.
This commit is contained in:
parent
eab564d857
commit
4f60117db9
1 changed files with 5 additions and 5 deletions
|
@ -1121,12 +1121,12 @@ gst_nvdec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
|
|||
|
||||
gst_query_parse_allocation (query, &outcaps, NULL);
|
||||
n = gst_query_get_n_allocation_pools (query);
|
||||
if (n > 0) {
|
||||
if (n > 0)
|
||||
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
|
||||
if (!GST_IS_GL_BUFFER_POOL (pool)) {
|
||||
gst_object_unref (pool);
|
||||
pool = NULL;
|
||||
}
|
||||
|
||||
if (pool && !GST_IS_GL_BUFFER_POOL (pool)) {
|
||||
gst_object_unref (pool);
|
||||
pool = NULL;
|
||||
}
|
||||
|
||||
if (!pool) {
|
||||
|
|
Loading…
Reference in a new issue