glbasememory: assert for a valid allocator instead of segfaulting

This commit is contained in:
Matthew Waters 2016-07-11 21:29:10 +10:00
parent 48c5cc1b1b
commit 6f4091bbd3
2 changed files with 3 additions and 1 deletions

View file

@ -732,6 +732,8 @@ gst_gl_base_memory_alloc (GstGLBaseMemoryAllocator * allocator,
{
GstGLBaseMemoryAllocatorClass *alloc_class;
g_return_val_if_fail (GST_IS_GL_BASE_MEMORY_ALLOCATOR (allocator), NULL);
alloc_class = GST_GL_BASE_MEMORY_ALLOCATOR_GET_CLASS (allocator);
g_return_val_if_fail (alloc_class != NULL, NULL);

View file

@ -32,7 +32,7 @@ G_BEGIN_DECLS
#define GST_TYPE_GL_BASE_MEMORY_ALLOCATOR (gst_gl_base_memory_allocator_get_type())
GType gst_gl_base_memory_allocator_get_type(void);
#define GST_IS_GL_BASE_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_ALLOCATOR))
#define GST_IS_GL_BASE_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR))
#define GST_IS_GL_BASE_MEMORY_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR))
#define GST_GL_BASE_MEMORY_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR, GstGLBaseMemoryAllocatorClass))
#define GST_GL_BASE_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR, GstGLBaseMemoryAllocator))