Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
bcba79ce
Commit
bcba79ce
authored
Aug 28, 2022
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid calling fwrite() with nullptr (which is undefined behaviour).
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
4e6c300b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
rawoutputstream.cc
src/rawoutputstream.cc
+3
-0
stdoutwavoutputstream.cc
src/stdoutwavoutputstream.cc
+4
-1
No files found.
src/rawoutputstream.cc
View file @
bcba79ce
...
...
@@ -88,6 +88,9 @@ RawOutputStream::write_frames (const vector<float>& samples)
{
assert
(
m_state
==
State
::
OPEN
);
if
(
samples
.
empty
())
return
Error
::
Code
::
NONE
;
vector
<
unsigned
char
>
bytes
;
m_raw_converter
->
to_raw
(
samples
,
bytes
);
...
...
src/stdoutwavoutputstream.cc
View file @
bcba79ce
...
...
@@ -132,11 +132,14 @@ StdoutWavOutputStream::open (int n_channels, int sample_rate, int bit_depth, siz
Error
StdoutWavOutputStream
::
write_frames
(
const
vector
<
float
>&
samples
)
{
if
(
samples
.
empty
())
return
Error
::
Code
::
NONE
;
vector
<
unsigned
char
>
output_bytes
;
m_raw_converter
->
to_raw
(
samples
,
output_bytes
);
fwrite
(
output_bytes
.
data
()
,
1
,
output_bytes
.
size
(),
stdout
);
fwrite
(
&
output_bytes
[
0
]
,
1
,
output_bytes
.
size
(),
stdout
);
if
(
ferror
(
stdout
))
return
Error
(
"write sample data failed"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment