mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
gst/ffmpegcolorspace/gstffmpegcolorspace.c: Plug some memory leaks.
Original commit message from CVS: * gst/ffmpegcolorspace/gstffmpegcolorspace.c: (gst_ffmpegcsp_transform_caps), (gst_ffmpegcsp_set_caps), (gst_ffmpegcsp_finalize), (gst_ffmpegcsp_class_init), (gst_ffmpegcsp_get_unit_size): Plug some memory leaks.
This commit is contained in:
parent
c93d1b1c2a
commit
bd584e6b92
2 changed files with 26 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
2006-02-24 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
|
||||
(gst_ffmpegcsp_transform_caps), (gst_ffmpegcsp_set_caps),
|
||||
(gst_ffmpegcsp_finalize), (gst_ffmpegcsp_class_init),
|
||||
(gst_ffmpegcsp_get_unit_size):
|
||||
Plug some memory leaks.
|
||||
|
||||
2006-02-24 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* sys/ximage/Makefile.am:
|
||||
|
|
|
@ -147,6 +147,7 @@ gst_ffmpegcsp_transform_caps (GstBaseTransform * btrans,
|
|||
|
||||
template = gst_ffmpegcsp_codectype_to_caps (CODEC_TYPE_VIDEO, NULL);
|
||||
result = gst_caps_intersect (caps, template);
|
||||
gst_caps_unref (template);
|
||||
|
||||
gst_caps_append (result, gst_ffmpegcsp_caps_remove_format_info (caps));
|
||||
|
||||
|
@ -231,6 +232,7 @@ gst_ffmpegcsp_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
|
|||
if (space->palette)
|
||||
av_free (space->palette);
|
||||
space->palette = ctx->palctrl;
|
||||
ctx->palctrl = NULL;
|
||||
|
||||
/* get to format */
|
||||
ctx->pix_fmt = PIX_FMT_NB;
|
||||
|
@ -320,6 +322,17 @@ gst_ffmpegcsp_base_init (GstFFMpegCspClass * klass)
|
|||
gst_element_class_set_details (element_class, &ffmpegcsp_details);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_ffmpegcsp_finalize (GObject * obj)
|
||||
{
|
||||
GstFFMpegCsp *space = GST_FFMPEGCSP (obj);
|
||||
|
||||
if (space->palette)
|
||||
av_free (space->palette);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_ffmpegcsp_class_init (GstFFMpegCspClass * klass)
|
||||
{
|
||||
|
@ -331,7 +344,9 @@ gst_ffmpegcsp_class_init (GstFFMpegCspClass * klass)
|
|||
gstelement_class = (GstElementClass *) klass;
|
||||
gstbasetransform_class = (GstBaseTransformClass *) klass;
|
||||
|
||||
parent_class = g_type_class_ref (GST_TYPE_BASE_TRANSFORM);
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_ffmpegcsp_finalize);
|
||||
|
||||
gstbasetransform_class->transform_caps =
|
||||
GST_DEBUG_FUNCPTR (gst_ffmpegcsp_transform_caps);
|
||||
|
@ -386,6 +401,8 @@ gst_ffmpegcsp_get_unit_size (GstBaseTransform * btrans, GstCaps * caps,
|
|||
if (space->palette)
|
||||
*size -= 4 * 256;
|
||||
|
||||
if (ctx->palctrl)
|
||||
av_free (ctx->palctrl);
|
||||
av_free (ctx);
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue