aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Berndt <lukekb@gmail.com>2022-12-04 09:46:15 -0500
committerGitHub <noreply@github.com>2022-12-04 09:46:15 -0500
commitba513819389148a89c7a036ca0e8fa170116e16a (patch)
tree328af664cf05012a8f8ff9f26ea4b04803252e73
parente16debd414dd3fc5d053c96e0c73f3ebf775931c (diff)
parent48019917c5c0864e89b98311379841e81a75f02f (diff)
Merge pull request #739 from galenguyer/simplestream-segfault
Set d_call to null to prevent potential use after free
-rw-r--r--trunk-recorder/recorders/p25_recorder_decode.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/trunk-recorder/recorders/p25_recorder_decode.cc b/trunk-recorder/recorders/p25_recorder_decode.cc
index e8ad611a..ca740418 100644
--- a/trunk-recorder/recorders/p25_recorder_decode.cc
+++ b/trunk-recorder/recorders/p25_recorder_decode.cc
@@ -21,6 +21,7 @@ p25_recorder_decode::~p25_recorder_decode() {
void p25_recorder_decode::stop() {
wav_sink->stop_recording();
+ d_call = NULL;
}
void p25_recorder_decode::start(Call *call) {
@@ -112,7 +113,9 @@ void p25_recorder_decode::initialize(int silence_frames) {
}
void p25_recorder_decode::plugin_callback_handler(int16_t *samples, int sampleCount) {
- plugman_audio_callback(d_call, d_recorder, samples, sampleCount);
+ if (d_call) {
+ plugman_audio_callback(d_call, d_recorder, samples, sampleCount);
+ }
}
double p25_recorder_decode::get_output_sample_rate() {