diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2005-04-02 08:18:04 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2005-04-02 08:18:04 +0000 |
commit | 313e51a586b78d5af455228d0ac11a9a7d00c3f0 (patch) | |
tree | d074dd1ffb57410be5b94acd45f94533bf6676dd | |
parent | d63f08d6a6ddf834eee99ff50e696a5b36535938 (diff) | |
download | gst-plugins-bad-313e51a586b78d5af455228d0ac11a9a7d00c3f0.tar.gz gst-plugins-bad-313e51a586b78d5af455228d0ac11a9a7d00c3f0.tar.bz2 gst-plugins-bad-313e51a586b78d5af455228d0ac11a9a7d00c3f0.zip |
gst/speed/gstspeed.c: Fix buffer overflow (#172281).
Original commit message from CVS:
* gst/speed/gstspeed.c: (speed_chain):
Fix buffer overflow (#172281).
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gst/speed/gstspeed.c | 3 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2005-04-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + + * gst/speed/gstspeed.c: (speed_chain): + Fix buffer overflow (#172281). + 2005-04-01 Ronald S. Bultje <rbultje@ronald.bitfreak.net> * gst/playback/gstplaybin.c: (gst_play_bin_class_init), diff --git a/gst/speed/gstspeed.c b/gst/speed/gstspeed.c index 88972b9d..8a447fe3 100644 --- a/gst/speed/gstspeed.c +++ b/gst/speed/gstspeed.c @@ -489,7 +489,10 @@ speed_chain (GstPad * pad, GstData * data) in_buf = GST_BUFFER (data); + /* buffersize has to be aligned by samplesize */ out_size = ceil ((gfloat) GST_BUFFER_SIZE (in_buf) / filter->speed); + out_size = (filter->sample_size * (out_size + filter->sample_size - 1)) / + filter->sample_size; out_buf = gst_pad_alloc_buffer (filter->srcpad, -1, out_size); in_samples = GST_BUFFER_SIZE (in_buf) / filter->sample_size; |