mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
wavparse: Actually clip to upstream size instead of size of the data chunk
There might be other chunks after the data chunk, so clipping the chunk
size with the data size can lead to a negative number and all following
calculations go wrong and cause crashes or worse.
This was introduced in 3ac119bbe2
.
https://bugzilla.gnome.org/show_bug.cgi?id=783760
This commit is contained in:
parent
96cd941788
commit
a82e38d607
1 changed files with 3 additions and 2 deletions
|
@ -1285,9 +1285,10 @@ gst_wavparse_stream_headers (GstWavParse * wav)
|
|||
}
|
||||
|
||||
/* Clip to upstream size if known */
|
||||
if (wav->datasize > 0 && size + wav->offset > wav->datasize) {
|
||||
if (upstream_size > 0 && size + wav->offset > upstream_size) {
|
||||
GST_WARNING_OBJECT (wav, "Clipping chunk size to file size");
|
||||
size = wav->datasize - wav->offset;
|
||||
g_assert (upstream_size >= wav->offset);
|
||||
size = upstream_size - wav->offset;
|
||||
}
|
||||
|
||||
/* wav is a st00pid format, we don't know for sure where data starts.
|
||||
|
|
Loading…
Reference in a new issue