adapter: Add check for pattern bits not in mask
authorDavid Schleef <ds@schleef.org>
Sun, 19 Sep 2010 02:29:09 +0000 (19:29 -0700)
committerDavid Schleef <ds@schleef.org>
Sun, 19 Sep 2010 02:29:09 +0000 (19:29 -0700)
libs/gst/base/gstadapter.c

index d76290c..07a5bb1 100644 (file)
@@ -880,6 +880,7 @@ gst_adapter_masked_scan_uint32_peek (GstAdapter * adapter, guint32 mask,
 
   g_return_val_if_fail (size > 0, -1);
   g_return_val_if_fail (offset + size <= adapter->size, -1);
+  g_return_val_if_fail (((~mask) & pattern) == 0, -1);
 
   /* we can't find the pattern with less than 4 bytes */
   if (G_UNLIKELY (size < 4))