[gst-cvs] gst-plugins-bad: pnmdec: Don't crash if no valid input was parsed yet
Benjamin Otte
company at kemper.freedesktop.org
Wed Jun 16 01:34:22 PDT 2010
Module: gst-plugins-bad
Branch: master
Commit: 147e0682b48d1be4ce0f3b9f6562798f74ecf426
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=147e0682b48d1be4ce0f3b9f6562798f74ecf426
Author: Benjamin Otte <otte at redhat.com>
Date: Wed Jun 16 10:31:19 2010 +0200
pnmdec: Don't crash if no valid input was parsed yet
https://bugzilla.redhat.com/show_bug.cgi?id=603771
---
gst/pnm/gstpnmdec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gst/pnm/gstpnmdec.c b/gst/pnm/gstpnmdec.c
index 4ad2766..060af2d 100644
--- a/gst/pnm/gstpnmdec.c
+++ b/gst/pnm/gstpnmdec.c
@@ -185,7 +185,7 @@ gst_pnmdec_chain_ascii (GstPnmdec * s, GstPad * src, GstBuffer * buf)
g_scanner_destroy (scanner);
/* If we didn't get the whole image, handle the last byte with care. */
- if (i < target && b[bs - 1] > '0' && b[bs - 1] <= '9')
+ if (i && i < target && b[bs - 1] > '0' && b[bs - 1] <= '9')
s->last_byte = GST_BUFFER_DATA (out)[--i];
gst_buffer_unref (buf);
More information about the Gstreamer-commits
mailing list