From 52d269b6b19e1eb46a8b41a13f58e4ffb6692097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 11 Apr 2013 13:25:51 -0400 Subject: [PATCH] videometa: gst_buffer_add_meta() can return NULL https://bugzilla.gnome.org/show_bug.cgi?id=697824 --- gst-libs/gst/video/gstvideometa.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gst-libs/gst/video/gstvideometa.c b/gst-libs/gst/video/gstvideometa.c index 13883f1c04..dfce22e153 100644 --- a/gst-libs/gst/video/gstvideometa.c +++ b/gst-libs/gst/video/gstvideometa.c @@ -36,6 +36,10 @@ gst_video_meta_transform (GstBuffer * dest, GstMeta * meta, dmeta = (GstVideoMeta *) gst_buffer_add_meta (dest, GST_VIDEO_META_INFO, NULL); + + if (!dmeta) + return FALSE; + dmeta->buffer = dest; GST_DEBUG ("copy video metadata"); @@ -221,6 +225,9 @@ gst_buffer_add_video_meta_full (GstBuffer * buffer, meta = (GstVideoMeta *) gst_buffer_add_meta (buffer, GST_VIDEO_META_INFO, NULL); + if (!meta) + return NULL; + meta->flags = flags; meta->format = format; meta->id = 0; @@ -419,6 +426,10 @@ gst_video_gl_texture_upload_meta_transform (GstBuffer * dest, GstMeta * meta, dmeta = (GstVideoGLTextureUploadMeta *) gst_buffer_add_meta (dest, GST_VIDEO_GL_TEXTURE_UPLOAD_META_INFO, NULL); + + if (!dmeta) + return FALSE; + dmeta->buffer = dest; dmeta->upload = smeta->upload; dmeta->user_data = smeta->user_data; @@ -476,6 +487,9 @@ gst_buffer_add_video_gl_texture_upload_meta (GstBuffer * buffer, (GstVideoGLTextureUploadMeta *) gst_buffer_add_meta (buffer, GST_VIDEO_GL_TEXTURE_UPLOAD_META_INFO, NULL); + if (!meta) + return NULL; + meta->buffer = buffer; meta->upload = upload; meta->user_data = user_data;