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..aa23e8d 100644
a
|
b
|
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); |
404 | | } |
405 | | else |
406 | | { |
407 | | pSoundStretch->setSampleRate(audio_samplerate); |
408 | | pSoundStretch->setChannels(audio_channels); |
| 399 | |
| 400 | if (encoder) |
| 401 | { |
| 402 | pSoundStretch->setSampleRate(audio_codec->sample_rate); |
| 403 | pSoundStretch->setChannels(audio_codec->channels); |
| 404 | } |
| 405 | else |
| 406 | { |
| 407 | pSoundStretch->setSampleRate(audio_samplerate); |
| 408 | pSoundStretch->setChannels(audio_channels); |
| 409 | } |
409 | 410 | } |
410 | 411 | } |
411 | 412 | } |