mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
wavparse: treat a zero-sized data chunk as extending to the end of the file.
This fixes playback of some files that don't have a valid data chunk length, apparently some program creates these.
This commit is contained in:
parent
00ffa9c2dd
commit
3257374310
1 changed files with 7 additions and 2 deletions
|
@ -1351,8 +1351,13 @@ gst_wavparse_stream_headers (GstWavParse * wav)
|
||||||
}
|
}
|
||||||
wav->offset += 8;
|
wav->offset += 8;
|
||||||
wav->datastart = wav->offset;
|
wav->datastart = wav->offset;
|
||||||
/* file might be truncated */
|
/* If size is zero, then the data chunk probably actually extends to
|
||||||
if (upstream_size) {
|
the end of the file */
|
||||||
|
if (size == 0 && upstream_size) {
|
||||||
|
size = upstream_size - wav->datastart;
|
||||||
|
}
|
||||||
|
/* Or the file might be truncated */
|
||||||
|
else if (upstream_size) {
|
||||||
size = MIN (size, (upstream_size - wav->datastart));
|
size = MIN (size, (upstream_size - wav->datastart));
|
||||||
}
|
}
|
||||||
wav->datasize = (guint64) size;
|
wav->datasize = (guint64) size;
|
||||||
|
|
Loading…
Reference in a new issue