aiffmux: avoid integer overflow

These values are 32 bits, and width is a multiple of 8.

https://bugzilla.gnome.org/show_bug.cgi?id=654278
This commit is contained in:
Vincent Penquerc'h 2011-08-16 10:02:11 +01:00 committed by Tim-Philipp Müller
parent ffa9c81798
commit fb2479d1da

View file

@ -236,7 +236,7 @@ gst_aiff_mux_write_comm_header (GstAiffMux * aiffmux, guint audio_data_size,
gst_byte_writer_put_uint16_be (writer, aiffmux->channels);
/* numSampleFrames value will be overwritten when known */
gst_byte_writer_put_uint32_be (writer,
(audio_data_size * 8) / (aiffmux->width * aiffmux->channels));
audio_data_size / (aiffmux->width / 8 * aiffmux->channels));
gst_byte_writer_put_uint16_be (writer, aiffmux->depth);
gst_aiff_mux_write_ext (writer, aiffmux->rate);
}