summaryrefslogtreecommitdiff
blob: 8300d4b2311b2e9de8902ccaa88145921fc55f0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
commit 79974e7ad94e7658c780e3b446a7822a533675e4
Author: wm4 <wm4@nowhere>
Date:   Fri Jul 15 23:11:25 2016 +0200

audio: fix crashes due to broken uninit check

Since mixer->ao is always NULL now (it was really just forgotten to be
removed), the uninit call never actually cleared the af field, leaving
a dangling pointer that could be accessed by volume control.

diff --git a/audio/mixer.c b/audio/mixer.c
index a58a814..795edfa 100644
--- a/audio/mixer.c
+++ b/audio/mixer.c
@@ -23,7 +23,6 @@
 #include <libavutil/common.h>

 #include "config.h"
-#include "audio/out/ao.h"
 #include "audio/filter/af.h"
 #include "common/global.h"
 #include "common/msg.h"
@@ -33,7 +32,6 @@
 struct mixer {
     struct mp_log *log;
     struct MPOpts *opts;
-    struct ao *ao;
     struct af_stream *af;
     // Other stuff
     float balance;
@@ -145,8 +143,5 @@ void mixer_reinit_audio(struct mixer *mixer, struct af_stream *af)
  */
 void mixer_uninit_audio(struct mixer *mixer)
 {
-    if (!mixer->ao)
-        return;
-
     mixer->af = NULL;
 }