[supercollider/supercollider] 9ebc3a: scsynth: initialize memory for SF_INFO structs

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[supercollider/supercollider] 9ebc3a: scsynth: initialize memory for SF_INFO structs

noreply
  Branch: refs/heads/master
  Home:   https://github.com/supercollider/supercollider
  Commit: 9ebc3a56d5d6b032abf57c23d5ac6c9f9e219aaa
      https://github.com/supercollider/supercollider/commit/9ebc3a56d5d6b032abf57c23d5ac6c9f9e219aaa
  Author: Nathan Ho <[hidden email]>
  Date:   2017-03-13 (Mon, 13 Mar 2017)

  Changed paths:
    M server/scsynth/SC_SequencedCommand.cpp

  Log Message:
  -----------
  scsynth: initialize memory for SF_INFO structs

This fixes an uninitialized memory issue in /b_read and /b_readChannel, which was causing nondeterministic failures in Buffer.cueSoundFile. libsndfile's sf_open takes as input a pointer to an SF_INFO struct, to which it writes its soundfile metadata. However, the SF_INFO struct's "format" parameter of the struct must be set to zero, otherwise (as best as I can tell from the sf_open docs) the audio is read in a RAW format. Failure to initialize the SF_INFO memory is therefore a bad idea, and zeroing out the memory ensures that the RAW format is not accidentally invoked.


  Commit: 9ccc33c46babc88293a8e721472de4940721791d
      https://github.com/supercollider/supercollider/commit/9ccc33c46babc88293a8e721472de4940721791d
  Author: vivid-synth <[hidden email]>
  Date:   2017-03-13 (Mon, 13 Mar 2017)

  Changed paths:
    M server/scsynth/SC_SequencedCommand.cpp

  Log Message:
  -----------
  Merge pull request #2793 from snappizz/topic/sf-info-initialization

scsynth: /b_read[Channel]: fix failure in sf_open caused by uninitialized memory


Compare: https://github.com/supercollider/supercollider/compare/de6ed210cc0b...9ccc33c46bab
Loading...