omxvideodec: Check return values of buffer pool config parsing functions
authorSebastian Dröge <sebastian@centricular.com>
Mon, 19 May 2014 07:01:46 +0000 (09:01 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 19 May 2014 07:01:46 +0000 (09:01 +0200)
CID 1214588

omx/gstomxvideodec.c

index 335d17c85696f0e237ba56a8a11c4d7db31f8084..27f3b3ba23868a9b31dd8f4b5f44d41f33b239ee 100644 (file)
@@ -561,8 +561,16 @@ gst_omx_video_dec_allocate_output_buffers (GstOMXVideoDec * self)
     GstAllocator *allocator;
 
     config = gst_buffer_pool_get_config (pool);
-    gst_buffer_pool_config_get_params (config, &caps, NULL, &min, &max);
-    gst_buffer_pool_config_get_allocator (config, &allocator, NULL);
+    if (!gst_buffer_pool_config_get_params (config, &caps, NULL, &min, &max)) {
+      GST_ERROR_OBJECT (self, "Can't get buffer pool params");
+      err = OMX_ErrorUndefined;
+      goto done;
+    }
+    if (!gst_buffer_pool_config_get_allocator (config, &allocator, NULL)) {
+      GST_ERROR_OBJECT (self, "Can't get buffer pool allocator");
+      err = OMX_ErrorUndefined;
+      goto done;
+    }
 
     /* Need at least 2 buffers for anything meaningful */
     min = MAX (MAX (min, port->port_def.nBufferCountMin), 4);