+2004-12-18 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
+ * ext/alsa/gstalsasink.c: (gst_alsa_sink_loop):
+ Fix for integer overflow. Makes #156001 not crash. Probably masks
+ the real bug.
+
2004-12-17 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/ac3parse/gstac3parse.c: (plugin_init):
/* there are empty samples in front of us, fill them with silence */
int samples = MIN (bytes, sample_diff) *
(element->numpads == 1 ? this->format->channels : 1);
- int size =
- samples * snd_pcm_format_physical_width (this->format->format) /
- 8;
+ int width = snd_pcm_format_physical_width (this->format->format);
+ int size = samples * width / 8;
+
+ if (size / (width / 8) != samples) {
+ GST_WARNING_OBJECT (this,
+ "Integer overflow for size=%d/samples=%d - broken stream",
+ size, samples);
+ goto no_difference;
+ }
GST_INFO_OBJECT (this,
"Allocating %d bytes (%ld samples) now to resync: sample %lu expected, but got %ld",
size, MIN (bytes, sample_diff), expected, samplestamp);