Commit 218294b9 authored by Vincent Penquerc'h's avatar Vincent Penquerc'h

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
parent 590e20cb
......@@ -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;
......
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