In Reconfigure there is a point where the audio_codec pointer is dereferenced but
From: Erik Hovland <erik@hovland.org>
not checked for null. This can cause a segfault. This patch adds the check.
---
libs/libmyth/audiooutputbase.cpp | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/libs/libmyth/audiooutputbase.cpp b/libs/libmyth/audiooutputbase.cpp
index 9bcbe97..d7c685c 100644
a
|
b
|
void AudioOutputBase::SetStretchFactorLocked(float laudio_stretchfactor) |
147 | 147 | QString("Failed to Create Encoder")); |
148 | 148 | } |
149 | 149 | } |
150 | | } |
151 | | if (encoder) |
152 | | { |
153 | | pSoundStretch->setSampleRate(audio_codec->sample_rate); |
154 | | pSoundStretch->setChannels(audio_codec->channels); |
| 150 | if (encoder) |
| 151 | { |
| 152 | pSoundStretch->setSampleRate(audio_codec->sample_rate); |
| 153 | pSoundStretch->setChannels(audio_codec->channels); |
| 154 | } |
155 | 155 | } |
156 | 156 | else |
157 | 157 | { |
… |
… |
void AudioOutputBase::Reconfigure(int laudio_bits, int laudio_channels, |
396 | 396 | VERBOSE(VB_AUDIO, LOC + "Failed to Create Encoder"); |
397 | 397 | } |
398 | 398 | } |
399 | | } |
400 | | if (encoder) |
401 | | { |
402 | | pSoundStretch->setSampleRate(audio_codec->sample_rate); |
403 | | pSoundStretch->setChannels(audio_codec->channels); |
| 399 | |
| 400 | if (encoder) |
| 401 | { |
| 402 | pSoundStretch->setSampleRate(audio_codec->sample_rate); |
| 403 | pSoundStretch->setChannels(audio_codec->channels); |
| 404 | } |
404 | 405 | } |
405 | 406 | else |
406 | 407 | { |