octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #50674] audiorecorder() crashes in getaudiodat


From: Lars Kindermann
Subject: [Octave-bug-tracker] [bug #50674] audiorecorder() crashes in getaudiodata()
Date: Mon, 4 Jun 2018 10:31:12 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0

Follow-up Comment #9, bug #50674 (project octave):

Here is a much smaller patch. It adresses just a possible buffer  increase
during getaudiodata() but it seems to fix the problem completely for me. Can
somebody else please test?  


diff -r 13b1b9a0d9c5 libinterp/dldfcn/audiodevinfo.cc
--- a/libinterp/dldfcn/audiodevinfo.cc  Sun Jun 03 19:51:11 2018 +0200
+++ b/libinterp/dldfcn/audiodevinfo.cc  Mon Jun 04 15:32:40 2018 +0200
@@ -1637,9 +1637,12 @@
 octave_value
 audiorecorder::getaudiodata (void)
 {
-  Matrix audio (2, left.size ());
-
-  for (unsigned int i = 0; i < left.size (); i++)
+
+  unsigned int ls = left.size ();
+  
+  Matrix audio (2, ls);
+
+  for (unsigned int i = 0; i < ls; i++)
     {
       audio(0,i) = left[i];
       audio(1,i) = right[i];




(file #44291)
    _______________________________________________________

Additional Item Attachment:

File name: diffs_v2.txt                   Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50674>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]