riff: prevent crash if rounded up tag size exceeds data size

When rounding up `tsize' exceeds the remaining buffer size, `size' underflows
and an invalid read past the buffer data follows.
This commit is contained in:
René Stadler 2009-06-27 00:50:54 +03:00
parent 939baee2bd
commit 41b7504e9c

View file

@ -728,8 +728,11 @@ gst_riff_parse_info (GstElement * element,
}
}
if (tsize & 1)
if (tsize & 1) {
tsize++;
if (tsize > size)
tsize = size;
}
data += tsize;
size -= tsize;