summaryrefslogtreecommitdiff
path: root/ext/wavpack
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-03-06 14:25:27 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-03-06 14:25:27 +0100
commit4101f87d1767c2f8b87d099a6212c0a0317af8ca (patch)
tree438f039441ed541e982df95ee69afb29073b15d7 /ext/wavpack
parent9d5e5ea55329748148a1cc16f08ade5376e5c02e (diff)
downloadgstreamer-plugins-good-4101f87d1767c2f8b87d099a6212c0a0317af8ca.tar.gz
wavpack: Fix possible underflow of unsigned integer variable
Diffstat (limited to 'ext/wavpack')
-rw-r--r--ext/wavpack/gstwavpackstreamreader.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/wavpack/gstwavpackstreamreader.c b/ext/wavpack/gstwavpackstreamreader.c
index 074a2e7d5..da1fdc27b 100644
--- a/ext/wavpack/gstwavpackstreamreader.c
+++ b/ext/wavpack/gstwavpackstreamreader.c
@@ -78,9 +78,10 @@ gst_wavpack_stream_reader_push_back_byte (void *id, int c)
GST_DEBUG ("Pushing back one byte: 0x%x", c);
+ if (rid->position == 0)
+ return rid->position;
+
rid->position -= 1;
- if (rid->position < 0)
- rid->position = 0;
return rid->position;
}