qtmux: handle 0 size packets without dividing by 0
Coverity 1139691
This commit is contained in:
parent
b692539b55
commit
1be86ebb2a
@ -2387,7 +2387,10 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
|
|||||||
} else {
|
} else {
|
||||||
nsamples = gst_buffer_get_size (last_buf) / sample_size;
|
nsamples = gst_buffer_get_size (last_buf) / sample_size;
|
||||||
}
|
}
|
||||||
|
if (nsamples > 0)
|
||||||
duration = GST_BUFFER_DURATION (last_buf) / nsamples;
|
duration = GST_BUFFER_DURATION (last_buf) / nsamples;
|
||||||
|
else
|
||||||
|
duration = 0;
|
||||||
|
|
||||||
/* timescale = samplerate */
|
/* timescale = samplerate */
|
||||||
scaled_duration = 1;
|
scaled_duration = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user