Permalink
Browse files

AudioOutputOSS: Fix Coverity 700224, 700225. Unchecked return value (…

…of ioctl)
  • Loading branch information...
stuartm committed Jun 9, 2013
1 parent c127190 commit f796163ef09b7317931d89e94b97d59cd07eec8a
Showing with 5 additions and 2 deletions.
  1. +1 −0 mythtv/libs/libmyth/audio/audiooutputbase.h
  2. +4 −2 mythtv/libs/libmyth/audio/audiooutputoss.cpp
@@ -25,6 +25,7 @@ using namespace std;
#define VBERROR(str) LOG(VB_GENERAL, LOG_ERR, LOC + str)
#define VBWARN(str) LOG(VB_GENERAL, LOG_WARNING, LOC + str)
#define VBERRENO(str) Error(LOC + str + ": " + ENO)
#define VBERRNOCONST(str) LOG(VB_GENERAL, LOG_ERR, LOC + str + ": " + ENO)
namespace soundtouch {
class SoundTouch;
@@ -202,7 +202,8 @@ bool AudioOutputOSS::OpenDevice()
}
audio_buf_info info;
ioctl(audiofd, SNDCTL_DSP_GETOSPACE, &info);
if (ioctl(audiofd, SNDCTL_DSP_GETOSPACE, &info) < 0)
VBERRENO("Error retrieving card buffer size");
// align by frame size
fragment_size = info.fragsize - (info.fragsize % output_bytes_per_frame);
@@ -269,7 +270,8 @@ int AudioOutputOSS::GetBufferedOnSoundcard(void) const
int soundcard_buffer=0;
//GREG This is needs to be fixed for sure!
#ifdef SNDCTL_DSP_GETODELAY
ioctl(audiofd, SNDCTL_DSP_GETODELAY, &soundcard_buffer); // bytes
if(ioctl(audiofd, SNDCTL_DSP_GETODELAY, &soundcard_buffer) < 0) // bytes
VBERRNOCONST("Error retrieving buffering delay");
#endif
return soundcard_buffer;
}

0 comments on commit f796163

Please sign in to comment.