glviewconvert: fix a use-after-free with allocation params

_free(params) followed by a params->align is a bad idea :)
This commit is contained in:
Matthew Waters 2020-02-04 14:00:48 +11:00
parent cbffe13d60
commit af1986352b

View file

@ -1982,7 +1982,6 @@ _gen_buffer (GstGLViewConvert * viewconvert, GstBuffer ** target)
gst_object_unref (allocator);
return FALSE;
}
gst_gl_allocation_params_free ((GstGLAllocationParams *) params);
gst_object_unref (allocator);
meta = gst_buffer_add_video_meta_full (*target, 0,
@ -1995,6 +1994,8 @@ _gen_buffer (GstGLViewConvert * viewconvert, GstBuffer ** target)
if (params->valign)
gst_video_meta_set_alignment (meta, *params->valign);
gst_gl_allocation_params_free ((GstGLAllocationParams *) params);
return TRUE;
}