Skip to content

Commit

Permalink
multi_audio_node: check BBufferGroup init errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Numerio committed Jul 11, 2015
1 parent 714446c commit e3b2c4e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,14 @@ MultiAudioNode::SetBufferGroup(const media_source& for_source,
// our own buffer group to use from now on
size_t size = channel->fOutput.format.u.raw_audio.buffer_size;
int32 count = int32(fLatency / BufferDuration() + 1 + 1);
channel->fBufferGroup = new BBufferGroup(size, count);
BBufferGroup* group = new BBufferGroup(size, count);
if (group == NULL || group->InitCheck() != B_OK) {
delete group;
fprintf(stderr, "MultiAudioNode::SetBufferGroup failed to"
"instantiate a new group.\n");
return B_ERROR;
}
channel->fBufferGroup = group;
}

return B_OK;
Expand Down

0 comments on commit e3b2c4e

Please sign in to comment.