1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-03 15:06:45 +02:00

Dynamically allocate audio calls structure

This fixes a bug that caused a segfault when attempting to call a friend with a
friend number above the MAX_CALLS limit
This commit is contained in:
jfreegman
2017-11-20 07:02:56 -05:00
parent db7c9fe426
commit fe6a7074ea
4 changed files with 59 additions and 7 deletions

View File

@ -27,8 +27,6 @@
#include "audio_device.h"
#define MAX_CALLS 10
typedef enum _AudioError {
ae_None = 0,
ae_StartingCaptureDevice = 1 << 0,
@ -65,7 +63,9 @@ struct CallControl {
ToxAV *av;
ToxWindow *prompt;
Call calls[MAX_CALLS];
Call *calls;
uint32_t max_calls;
uint32_t call_state;
bool pending_call;
bool audio_enabled;
@ -89,5 +89,7 @@ void terminate_audio();
int start_transmission(ToxWindow *self, Call *call);
int stop_transmission(Call *call, uint32_t friend_number);
void stop_current_call(ToxWindow *self);
void init_friend_AV(uint32_t index);
void del_friend_AV(uint32_t index);
#endif /* AUDIO_CALL_H */