mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
gl: test for frame NULLness before dereferencing it
Coverity 1195172, 1195171
This commit is contained in:
parent
58206849b5
commit
c2fbe354c1
2 changed files with 12 additions and 2 deletions
|
@ -288,11 +288,16 @@ gst_gl_mosaic_callback (gpointer stuff)
|
||||||
guint width, height;
|
guint width, height;
|
||||||
|
|
||||||
frame = g_ptr_array_index (mosaic->input_frames, count);
|
frame = g_ptr_array_index (mosaic->input_frames, count);
|
||||||
|
if (!frame) {
|
||||||
|
GST_DEBUG ("skipping texture, null frame");
|
||||||
|
count++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
in_tex = frame->texture;
|
in_tex = frame->texture;
|
||||||
width = GST_VIDEO_INFO_WIDTH (&frame->pad->in_info);
|
width = GST_VIDEO_INFO_WIDTH (&frame->pad->in_info);
|
||||||
height = GST_VIDEO_INFO_HEIGHT (&frame->pad->in_info);
|
height = GST_VIDEO_INFO_HEIGHT (&frame->pad->in_info);
|
||||||
|
|
||||||
if (!frame || !in_tex || width <= 0 || height <= 0) {
|
if (!in_tex || width <= 0 || height <= 0) {
|
||||||
GST_DEBUG ("skipping texture:%u frame:%p width:%u height %u",
|
GST_DEBUG ("skipping texture:%u frame:%p width:%u height %u",
|
||||||
in_tex, frame, width, height);
|
in_tex, frame, width, height);
|
||||||
count++;
|
count++;
|
||||||
|
|
|
@ -235,10 +235,15 @@ gst_gl_video_mixer_callback (gpointer stuff)
|
||||||
gfloat w, h;
|
gfloat w, h;
|
||||||
|
|
||||||
frame = g_ptr_array_index (video_mixer->input_frames, count);
|
frame = g_ptr_array_index (video_mixer->input_frames, count);
|
||||||
|
if (!frame) {
|
||||||
|
GST_DEBUG ("skipping texture, null frame");
|
||||||
|
count++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
in_width = GST_VIDEO_INFO_WIDTH (&frame->pad->in_info);
|
in_width = GST_VIDEO_INFO_WIDTH (&frame->pad->in_info);
|
||||||
in_height = GST_VIDEO_INFO_HEIGHT (&frame->pad->in_info);
|
in_height = GST_VIDEO_INFO_HEIGHT (&frame->pad->in_info);
|
||||||
|
|
||||||
if (!frame || !frame->texture || in_width <= 0 || in_height <= 0) {
|
if (!frame->texture || in_width <= 0 || in_height <= 0) {
|
||||||
GST_DEBUG ("skipping texture:%u frame:%p width:%u height %u",
|
GST_DEBUG ("skipping texture:%u frame:%p width:%u height %u",
|
||||||
frame->texture, frame, in_width, in_height);
|
frame->texture, frame, in_width, in_height);
|
||||||
count++;
|
count++;
|
||||||
|
|
Loading…
Reference in a new issue