Fix for not checking zero width and height

Signed-off-by: Sanjay NM <sanjay.nm@samsung.com>

https://bugzilla.gnome.org/show_bug.cgi?id=729614
This commit is contained in:
Sanjay NM 2014-05-06 09:23:13 +05:30 committed by Luis de Bethencourt
parent b891bd04d5
commit bfdc543952

View file

@ -111,6 +111,11 @@ gst_pnmenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
gchar *header;
GstBuffer *out;
if ((s->info.width == 0) || (s->info.height == 0) || (s->info.fields == 0)) {
r = GST_FLOW_ERROR;
goto out;
}
/* 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,