mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
wavparse: clip chunk size above the valid maximum (0x7fffffff)
https://bugzilla.gnome.org/show_bug.cgi?id=722567
This commit is contained in:
parent
3ac119bbe2
commit
8cfebfec8c
1 changed files with 6 additions and 0 deletions
|
@ -1264,6 +1264,12 @@ gst_wavparse_stream_headers (GstWavParse * wav)
|
||||||
"Got TAG: %" GST_FOURCC_FORMAT ", offset %" G_GUINT64_FORMAT ", size %"
|
"Got TAG: %" GST_FOURCC_FORMAT ", offset %" G_GUINT64_FORMAT ", size %"
|
||||||
G_GUINT32_FORMAT, GST_FOURCC_ARGS (tag), wav->offset, size);
|
G_GUINT32_FORMAT, GST_FOURCC_ARGS (tag), wav->offset, size);
|
||||||
|
|
||||||
|
/* Maximum valid size is INT_MAX */
|
||||||
|
if (size & 0x80000000) {
|
||||||
|
GST_WARNING_OBJECT (wav, "Invalid size, clipping to 0x7fffffff");
|
||||||
|
size = 0x7fffffff;
|
||||||
|
}
|
||||||
|
|
||||||
/* Clip to upstream size if known */
|
/* Clip to upstream size if known */
|
||||||
if (wav->datasize > 0 && size + wav->offset > wav->datasize) {
|
if (wav->datasize > 0 && size + wav->offset > wav->datasize) {
|
||||||
GST_WARNING_OBJECT (wav, "Clipping chunk size to file size");
|
GST_WARNING_OBJECT (wav, "Clipping chunk size to file size");
|
||||||
|
|
Loading…
Reference in a new issue