diff options
author | Sanjay NM <sanjay.nm@samsung.com> | 2014-05-06 09:23:13 +0530 |
---|---|---|
committer | Luis de Bethencourt <luis@debethencourt.com> | 2014-05-06 00:27:49 -0400 |
commit | bfdc54395238c04fc6e5b51880c2d706f33e9011 (patch) | |
tree | 009a2099b44d3dad71f3c2ec08da4fe1216ee836 /gst | |
parent | b891bd04d50424410c43865f30150e3553f84b59 (diff) | |
download | gstreamer-plugins-bad-bfdc54395238c04fc6e5b51880c2d706f33e9011.tar.gz |
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
Diffstat (limited to 'gst')
-rw-r--r-- | gst/pnm/gstpnmenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/pnm/gstpnmenc.c b/gst/pnm/gstpnmenc.c index cfca151b3..a47e6055e 100644 --- a/gst/pnm/gstpnmenc.c +++ b/gst/pnm/gstpnmenc.c @@ -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, |