mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 11:10:37 +00:00
gl: prevent division by 0 on unsupported texture type
Coverity 1199697
This commit is contained in:
parent
b2fe0c50ff
commit
6ec86ca1dc
1 changed files with 5 additions and 1 deletions
|
@ -350,7 +350,11 @@ _calculate_unpack_length (GstGLMemory * gl_mem)
|
|||
gl_mem->unpack_length = 1;
|
||||
|
||||
n_gl_bytes = _gl_texture_type_n_bytes (gl_mem->tex_type);
|
||||
|
||||
if (n_gl_bytes == 0) {
|
||||
GST_CAT_ERROR (GST_CAT_GL_MEMORY, "Unsupported texture type %d",
|
||||
gl_mem->tex_type);
|
||||
return;
|
||||
}
|
||||
#if GST_GL_HAVE_OPENGL || GST_GL_HAVE_GLES3
|
||||
if (USING_OPENGL (gl_mem->context) || USING_GLES3 (gl_mem->context)) {
|
||||
gl_mem->unpack_length = gl_mem->stride / n_gl_bytes;
|
||||
|
|
Loading…
Reference in a new issue