From: <rb...@fr...> - 2004-12-18 15:09:44
|
CVS Root: /cvs/gstreamer Module: gst-plugins Changes by: rbultje Date: Sat Dec 18 2004 07:09:40 PST Log message: * ext/alsa/gstalsasink.c: (gst_alsa_sink_loop): Fix for integer overflow. Makes #156001 not crash. Probably masks the real bug. Modified files: . : ChangeLog ext/alsa : gstalsasink.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.1405&r2=1.1406 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/alsa/gstalsasink.c.diff?r1=1.34&r2=1.35 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.1405 retrieving revision 1.1406 diff -u -d -r1.1405 -r1.1406 --- ChangeLog 17 Dec 2004 17:09:24 -0000 1.1405 +++ ChangeLog 18 Dec 2004 15:09:27 -0000 1.1406 @@ -1,3 +1,9 @@ +2004-12-18 Ronald S. Bultje <rb...@ro...> + + * 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 <rb...@ro...> * gst/ac3parse/gstac3parse.c: (plugin_init): Index: gstalsasink.c RCS file: /cvs/gstreamer/gst-plugins/ext/alsa/gstalsasink.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- gstalsasink.c 28 Nov 2004 13:35:44 -0000 1.34 +++ gstalsasink.c 18 Dec 2004 15:09:27 -0000 1.35 @@ -440,9 +440,15 @@ /* 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); |