mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
frei0rfilter: fix memory corruption on sink caps changes.
When the input size changed, the frei0r filters didn't take it into account and ended up corrupting memory. Fixes #726069
This commit is contained in:
parent
cba13ef301
commit
09989e7c71
1 changed files with 10 additions and 0 deletions
|
@ -40,15 +40,25 @@ gst_frei0r_filter_set_caps (GstBaseTransform * trans, GstCaps * incaps,
|
|||
GstCaps * outcaps)
|
||||
{
|
||||
GstFrei0rFilter *self = GST_FREI0R_FILTER (trans);
|
||||
GstFrei0rFilterClass *klass = GST_FREI0R_FILTER_GET_CLASS (trans);
|
||||
GstVideoInfo info;
|
||||
gboolean destroy_f0r_instance = FALSE;
|
||||
|
||||
gst_video_info_init (&info);
|
||||
if (!gst_video_info_from_caps (&info, incaps))
|
||||
return FALSE;
|
||||
|
||||
if (self->width != info.width || self->height != info.height)
|
||||
destroy_f0r_instance = TRUE;
|
||||
|
||||
self->width = info.width;
|
||||
self->height = info.height;
|
||||
|
||||
if (self->f0r_instance && destroy_f0r_instance) {
|
||||
klass->ftable->destruct (self->f0r_instance);
|
||||
self->f0r_instance = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue