[supernova] fix /b_fill handler #4137
Conversation
|
Thanks for this PR! I was able to reproduce the issue, and this PR fixes things. Sorry for the silence. We are planning to have a Dev meeting next week to discuss 3.10 and future development. |
| data[index] = value; | ||
| if(++index >= bufSamples) { break; } |
nhthn
Nov 19, 2018
Contributor
thanks! minor code style issues here: please move ++index into its own line, add a space between if (, and move break to a separate line
thanks! minor code style issues here: please move ++index into its own line, add a space between if (, and move break to a separate line
|
thanks, please make formatting changes as suggested by @snappizz , and rebase this on the 3.10 branch |
|
ok no problem, i seem to be having some qt-related build issues with 3.10 but will hopefully sort it out presently. |
|
@brianlheim @snappizz how's this look to yall? (fwiw: i see many other violations of those formatting rules just in this source file. maybe uncrustify or clang-format is called for if the rules are serious. also documenting them would be nice.) and, er... should i fix the other lack of bounds checking? OSC is an external API after all, one can't assume every script in the world is well behaved. for example, i can confirm that this very evil sclang script will smash memory in supernova. usually this crashes it, and on at least one occasion i managed to take down the whole jack server.
oh and also - thanks for taking the time to review and for all your work on the project! |
both points are covered in our style guide which is referenced in our main CONTRIBUTING.md. but yes, the codebase (which has seen many contributors) doesn't have a consistent style. i am planning to add a clang-format file and reformat everything during a quiet period, hopefully sometime in the next month or so.
yes, please! (in a separate PR) thank you for noticing that. |
|
@bgola please double-check your indentation. also, it looks like you didn't rebase this onto 3.10 properly. it should be easy to squash everything to a single commit and cherry-pick it. i think this should work: git checkout 3.10 --detach
git cherry-pick -n 33dfb6c 466810b 685b182 e83acb1
git add --all
git commit -m "..."
git branch -f topic/fix-bfill-supernova
git checkout topic/fix-bfill-supernova
git push -f origin topic/fix-bfill-supernovafailing that you can just copy-paste the changes and create a new commit manually, just copy-paste instead of executing the cherry-pick command above. |
|
@catfact did you mean to close this? what would you like to happen with this PR? |
|
@brianlheim i am closing this b/c it is based on but you have asked me to rebase on ... aaand, nevermind again, somehow GH gets a little confused by that and the rebase becomes pointless. so, keeping this closed. |
@brianlheim did you mean to tag me here? was there something wrong with my PR? |
|
@bgola - oops, sorry, github autocompleted the wrong username!
I have found that in that situation, changing the base gets github to recalculate the commits. If the base is already the one you want you might have to change it twice. Pretty suboptimal on GH's part. |
Purpose and Motivation
noticed that
/b_fillcommands didn't seem to be doing anything in supernova.checking the source revealed that the sample index into the buffer data wasn't being incremented, so i added this.
i additionally added a bounds check for the index. surprisingly this doesn't happen in other command handlers like
/b_set. is there a non-obvious mechanism for this elsewhere, or is it possible to smash memory with OOB arguments to these commands?Types of changes
Checklist
i haven't added any unit tests, but of course would be happy to do so with a little more guidance.