... to mind unsigned integer wrap
Based on patch by Alban Browaeys <prahal@yahoo.com>
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=673436
GstByteReader br;
GList *ret = NULL;
- size -= offset;
-
if (!initialized) {
GST_DEBUG_CATEGORY_INIT (mpegvideo_parser_debug, "codecparsers_mpegvideo",
0, "Mpegvideo parser library");
initialized = TRUE;
}
- if (size <= 0) {
+ if (size <= offset) {
GST_DEBUG ("Can't parse from offset %d, buffer is to small", offset);
return NULL;
}
+ size -= offset;
+
gst_byte_reader_init (&br, &data[offset], size);
off = scan_for_start_codes (&br, 0, size);