Commit 3ac119bb authored by Vincent Penquerc'h's avatar Vincent Penquerc'h
Browse files

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).
parent bf95f93c
......@@ -1261,8 +1261,14 @@ gst_wavparse_stream_headers (GstWavParse * wav)
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment