mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
wavparse: avoid dividing by a 0 blockalign
This can be 0. In that case, do not try to cut off the last few bytes from the last buffer. Coverity 1146971
This commit is contained in:
parent
590e20cbc9
commit
218294b9f3
1 changed files with 4 additions and 2 deletions
|
@ -1938,8 +1938,10 @@ iterate_adapter:
|
||||||
|
|
||||||
GST_LOG_OBJECT (wav, "Got only %" G_GSIZE_FORMAT " bytes of data", size);
|
GST_LOG_OBJECT (wav, "Got only %" G_GSIZE_FORMAT " bytes of data", size);
|
||||||
if (size >= wav->blockalign) {
|
if (size >= wav->blockalign) {
|
||||||
buf = gst_buffer_make_writable (buf);
|
if (wav->blockalign > 0) {
|
||||||
gst_buffer_resize (buf, 0, size - (size % wav->blockalign));
|
buf = gst_buffer_make_writable (buf);
|
||||||
|
gst_buffer_resize (buf, 0, size - (size % wav->blockalign));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
goto found_eos;
|
goto found_eos;
|
||||||
|
|
Loading…
Reference in a new issue