summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-06-16 10:31:19 +0200
committerBenjamin Otte <otte@redhat.com>2010-06-16 10:31:19 +0200
commit147e0682b48d1be4ce0f3b9f6562798f74ecf426 (patch)
tree44467a3abe5674ac1c66ce613b53d49a85ce5b6d
parent0fba38f833bd9713c58f388f9d9b0a5ea1defbb9 (diff)
pnmdec: Don't crash if no valid input was parsed yet
https://bugzilla.redhat.com/show_bug.cgi?id=603771
-rw-r--r--gst/pnm/gstpnmdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gst/pnm/gstpnmdec.c b/gst/pnm/gstpnmdec.c
index 4ad2766fa..060af2dcc 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);