typefind: Avoid overflow calculation (image/quicktime)
authorEdward Hervey <edward@centricular.com>
Fri, 8 Dec 2017 07:00:07 +0000 (08:00 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 8 Dec 2017 08:12:33 +0000 (09:12 +0100)
The qt typefinder uses guint64 values for offset and size calculation
but the typefinder system only supports gint64 values.

Make sure we don't end up using potentially overflowing values.

gst/typefind/gsttypefindfunctions.c

index 0a66e3a..9d8005c 100644 (file)
@@ -3460,6 +3460,8 @@ qtif_type_find (GstTypeFind * tf, gpointer unused)
     }
 
     offset += size;
+    if (offset + 8 >= G_MAXINT64)
+      break;
     if (++rounds > QTIF_MAXROUNDS)
       break;
   }