gst_core_media_buffer_new and gst_core_video_texture_cache_get_gl_buffer
can fail for various platform reasons.
https://bugzilla.gnome.org/show_bug.cgi?id=748122
}
*buf = gst_core_media_buffer_new (sbuf, useVideoMeta, textureCache == NULL);
+ if (*buf == NULL) {
+ CFRelease (sbuf);
+ return GST_FLOW_ERROR;
+ }
+
if (format == GST_VIDEO_FORMAT_RGBA) {
/* So now buf contains BGRA data (!) . Since downstream is actually going to
* use the GL upload meta to get RGBA textures (??), we need to override the
}
CFRelease (sbuf);
- if (textureCache != NULL)
+ if (textureCache != NULL) {
*buf = gst_core_video_texture_cache_get_gl_buffer (textureCache, *buf);
+ if (*buf == NULL)
+ return GST_FLOW_ERROR;
+ }
GST_BUFFER_OFFSET (*buf) = offset++;
GST_BUFFER_OFFSET_END (*buf) = GST_BUFFER_OFFSET (*buf) + 1;