omxvideodec: Check return values of buffer pool config parsing functions

CID 1214588
This commit is contained in:
Sebastian Dröge 2014-05-19 09:01:46 +02:00
parent 59ac1dd03b
commit e08c0dc88a

View file

@ -561,8 +561,16 @@ gst_omx_video_dec_allocate_output_buffers (GstOMXVideoDec * self)
GstAllocator *allocator; GstAllocator *allocator;
config = gst_buffer_pool_get_config (pool); config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_get_params (config, &caps, NULL, &min, &max); if (!gst_buffer_pool_config_get_params (config, &caps, NULL, &min, &max)) {
gst_buffer_pool_config_get_allocator (config, &allocator, NULL); 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 */ /* Need at least 2 buffers for anything meaningful */
min = MAX (MAX (min, port->port_def.nBufferCountMin), 4); min = MAX (MAX (min, port->port_def.nBufferCountMin), 4);