mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +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;
|
||||
|
||||
|
||||
if ((s->info.width == 0) || (s->info.height == 0) || (s->info.fields == 0)) {
|
||||
r = GST_FLOW_ERROR;
|
||||
goto out;
|
||||
}
|
||||
if (s->info.width == 0 || s->info.height == 0 || s->info.fields == 0)
|
||||
goto not_negotiated;
|
||||
|
||||
/* Assumption: One buffer, one image. That is, always first write header. */
|
||||
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,
|
||||
|
@ -182,6 +181,12 @@ gst_pnmenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||
out:
|
||||
|
||||
return r;
|
||||
|
||||
not_negotiated:
|
||||
{
|
||||
gst_buffer_unref (buf);
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue