From b4f1778a7d8730a33d874a7271a03c40674d4e53 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 15 Jun 2010 15:33:37 +0200 Subject: [PATCH] baseparse: prevent arithmetic overflows in pull mode buffer cache handling --- gst/audioparsers/gstbaseparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index 985589a..f37b0bb 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -1341,8 +1341,8 @@ gst_base_parse_pull_range (GstBaseParse * parse, guint size, /* Caching here actually makes much less difference than one would expect. * We do it mainly to avoid pulling buffers of 1 byte all the time */ if (parse->priv->cache) { - guint64 cache_offset = GST_BUFFER_OFFSET (parse->priv->cache); - guint cache_size = GST_BUFFER_SIZE (parse->priv->cache); + gint64 cache_offset = GST_BUFFER_OFFSET (parse->priv->cache); + gint cache_size = GST_BUFFER_SIZE (parse->priv->cache); if (cache_offset <= parse->priv->offset && (parse->priv->offset + size) <= (cache_offset + cache_size)) { -- 2.7.4