mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-09-27 19:54:46 +00:00
soundserver_cubeb: Verify buffer is not null.
This commit is contained in:
parent
900e58f0ad
commit
86d8ae0911
@ -118,10 +118,9 @@ long sound_out_callback(cubeb_stream *stream, void *user_data,
|
||||
|
||||
while (req_frames > 0) {
|
||||
if (!dma_ch->pull_data((uint32_t)req_frames << 2, &got_len, &p_in)) {
|
||||
if ((in_buf = (int16_t*)p_in)) {
|
||||
frames = got_len >> 2;
|
||||
|
||||
in_buf = (int16_t*)p_in;
|
||||
|
||||
for (int i = (int)frames; i > 0; i--) {
|
||||
out_buf[0] = BYTESWAP_16(in_buf[0]);
|
||||
out_buf[1] = BYTESWAP_16(in_buf[1]);
|
||||
@ -132,6 +131,10 @@ long sound_out_callback(cubeb_stream *stream, void *user_data,
|
||||
req_frames -= frames;
|
||||
out_frames += frames;
|
||||
}
|
||||
else {
|
||||
LOG_F(ERROR, "Didn't get qdata");
|
||||
}
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user