From e8fe78824bc65a2b1f5166d2aa34099af6aaec4b Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Fri, 6 Jun 2014 17:56:06 +0200 Subject: [PATCH] decoder: h264: fix inter-view references array growth. Let the utility layer handle dynamic growth of the inter-view pictures array. By definition, setting a new size to the array will effectively grow the array, but would also fill in the newly created elements with empty entries (NULL), thus also increasing the reported length, which is not correct. --- gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index cfe7b026cd..1ce29833fd 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -977,9 +977,7 @@ mvc_reset(GstVaapiDecoderH264 *decoder) guint i; // Resize array of inter-view references - if (priv->inter_views) - g_ptr_array_set_size(priv->inter_views, priv->max_views); - else { + if (!priv->inter_views) { priv->inter_views = g_ptr_array_new_full(priv->max_views, (GDestroyNotify)unref_inter_view); if (!priv->inter_views)