Skip to content

Commit

Permalink
coverity fix - uninit pointer field - PortAudioDeviceDriver.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
damn1 authored and drdanz committed Dec 4, 2017
1 parent 990e49f commit cd6cfd7
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/devices/portaudio/PortAudioDeviceDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <portaudio.h>


#include <yarp/os/Time.h>

using namespace yarp::os;
Expand Down Expand Up @@ -121,18 +123,22 @@ static int bufferIOCallback( const void *inputBuffer, void *outputBuffer,
return paAbort;
}

PortAudioDeviceDriver::PortAudioDeviceDriver()
PortAudioDeviceDriver::PortAudioDeviceDriver() :
stream(0),
err(paNoError),
i(0),
numSamples(0),
numBytes(0),
system_resource(NULL),
numChannels(0),
frequency(0),
loopBack(false),
renderMode(RENDER_APPEND)
{
system_resource = NULL;
numSamples = 0;
numChannels = 0;
loopBack = false;
frequency = 0;
err = paNoError;
dataBuffers.playData = 0;
dataBuffers.recData = 0;
renderMode = RENDER_APPEND;
stream = 0;
memset(&inputParameters, 0, sizeof(PaStreamParameters));
memset(&outputParameters, 0, sizeof(PaStreamParameters));
memset(&dataBuffers, 0, sizeof(circularDataBuffers));
memset(&driverConfig, 0, sizeof(PortAudioDeviceDriverSettings));
}

PortAudioDeviceDriver::~PortAudioDeviceDriver()
Expand Down

0 comments on commit cd6cfd7

Please sign in to comment.