mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 17:50:36 +00:00
ext/alsa/gstalsasink.c: Fix for integer overflow. Makes #156001 not crash. Probably masks the real bug.
Original commit message from CVS: * ext/alsa/gstalsasink.c: (gst_alsa_sink_loop): Fix for integer overflow. Makes #156001 not crash. Probably masks the real bug.
This commit is contained in:
parent
d49b1dbf6c
commit
62787bcd62
2 changed files with 15 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
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>
|
2004-12-17 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* gst/ac3parse/gstac3parse.c: (plugin_init):
|
* gst/ac3parse/gstac3parse.c: (plugin_init):
|
||||||
|
|
|
@ -440,9 +440,15 @@ sink_restart:
|
||||||
/* there are empty samples in front of us, fill them with silence */
|
/* there are empty samples in front of us, fill them with silence */
|
||||||
int samples = MIN (bytes, sample_diff) *
|
int samples = MIN (bytes, sample_diff) *
|
||||||
(element->numpads == 1 ? this->format->channels : 1);
|
(element->numpads == 1 ? this->format->channels : 1);
|
||||||
int size =
|
int width = snd_pcm_format_physical_width (this->format->format);
|
||||||
samples * snd_pcm_format_physical_width (this->format->format) /
|
int size = samples * width / 8;
|
||||||
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,
|
GST_INFO_OBJECT (this,
|
||||||
"Allocating %d bytes (%ld samples) now to resync: sample %lu expected, but got %ld",
|
"Allocating %d bytes (%ld samples) now to resync: sample %lu expected, but got %ld",
|
||||||
size, MIN (bytes, sample_diff), expected, samplestamp);
|
size, MIN (bytes, sample_diff), expected, samplestamp);
|
||||||
|
|
Loading…
Reference in a new issue