mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
pnmenc: fix flow return and buffer leak in not-negotiated case
https://bugzilla.gnome.org/show_bug.cgi?id=729614
This commit is contained in:
parent
56db65d229
commit
e807ac077d
1 changed files with 9 additions and 4 deletions
|
@ -112,10 +112,9 @@ gst_pnmenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||||
GstBuffer *out;
|
GstBuffer *out;
|
||||||
|
|
||||||
|
|
||||||
if ((s->info.width == 0) || (s->info.height == 0) || (s->info.fields == 0)) {
|
if (s->info.width == 0 || s->info.height == 0 || s->info.fields == 0)
|
||||||
r = GST_FLOW_ERROR;
|
goto not_negotiated;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
/* Assumption: One buffer, one image. That is, always first write header. */
|
/* Assumption: One buffer, one image. That is, always first write header. */
|
||||||
header = g_strdup_printf ("P%i\n%i %i\n%i\n",
|
header = g_strdup_printf ("P%i\n%i %i\n%i\n",
|
||||||
s->info.type + 3 * (1 - s->info.encoding), s->info.width, s->info.height,
|
s->info.type + 3 * (1 - s->info.encoding), s->info.width, s->info.height,
|
||||||
|
@ -182,6 +181,12 @@ gst_pnmenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||||
out:
|
out:
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
not_negotiated:
|
||||||
|
{
|
||||||
|
gst_buffer_unref (buf);
|
||||||
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue