Commit 1be86ebb authored by Vincent Penquerc'h's avatar Vincent Penquerc'h

qtmux: handle 0 size packets without dividing by 0

Coverity 1139691
parent b692539b
......@@ -2387,7 +2387,10 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
} else {
nsamples = gst_buffer_get_size (last_buf) / sample_size;
}
duration = GST_BUFFER_DURATION (last_buf) / nsamples;
if (nsamples > 0)
duration = GST_BUFFER_DURATION (last_buf) / nsamples;
else
duration = 0;
/* timescale = samplerate */
scaled_duration = 1;
......
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