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:
Vincent Penquerc'h 2014-05-02 14:49:27 +01:00
parent 590e20cbc9
commit 218294b9f3

View file

@ -1938,8 +1938,10 @@ iterate_adapter:
GST_LOG_OBJECT (wav, "Got only %" G_GSIZE_FORMAT " bytes of data", size);
if (size >= wav->blockalign) {
buf = gst_buffer_make_writable (buf);
gst_buffer_resize (buf, 0, size - (size % wav->blockalign));
if (wav->blockalign > 0) {
buf = gst_buffer_make_writable (buf);
gst_buffer_resize (buf, 0, size - (size % wav->blockalign));
}
} else {
gst_buffer_unref (buf);
goto found_eos;