mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
wavparse: clip chunk length to available data (when known)
This prevents silly chunk lengths from possibly overflowing (at least when we know the actual data length). https://bugzilla.gnome.org/show_bug.cgi?id=722567
This commit is contained in:
parent
bf95f93c01
commit
3ac119bbe2
1 changed files with 8 additions and 2 deletions
|
@ -1261,8 +1261,14 @@ gst_wavparse_stream_headers (GstWavParse * wav)
|
|||
}
|
||||
|
||||
GST_INFO_OBJECT (wav,
|
||||
"Got TAG: %" GST_FOURCC_FORMAT ", offset %" G_GUINT64_FORMAT,
|
||||
GST_FOURCC_ARGS (tag), wav->offset);
|
||||
"Got TAG: %" GST_FOURCC_FORMAT ", offset %" G_GUINT64_FORMAT ", size %"
|
||||
G_GUINT32_FORMAT, GST_FOURCC_ARGS (tag), wav->offset, size);
|
||||
|
||||
/* Clip to upstream size if known */
|
||||
if (wav->datasize > 0 && size + wav->offset > wav->datasize) {
|
||||
GST_WARNING_OBJECT (wav, "Clipping chunk size to file size");
|
||||
size = wav->datasize - wav->offset;
|
||||
}
|
||||
|
||||
/* wav is a st00pid format, we don't know for sure where data starts.
|
||||
* So we have to go bit by bit until we find the 'data' header
|
||||
|
|
Loading…
Reference in a new issue