diff options
Diffstat (limited to 'toxav/toxav.c')
-rw-r--r-- | toxav/toxav.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c index 57d14942..f26834b1 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -123,13 +123,16 @@ ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error) | |||
123 | { | 123 | { |
124 | TOXAV_ERR_NEW rc = TOXAV_ERR_NEW_OK; | 124 | TOXAV_ERR_NEW rc = TOXAV_ERR_NEW_OK; |
125 | ToxAV *av = nullptr; | 125 | ToxAV *av = nullptr; |
126 | Messenger *m = (Messenger *)tox; | ||
127 | 126 | ||
128 | if (tox == nullptr) { | 127 | if (tox == nullptr) { |
129 | rc = TOXAV_ERR_NEW_NULL; | 128 | rc = TOXAV_ERR_NEW_NULL; |
130 | goto END; | 129 | goto END; |
131 | } | 130 | } |
132 | 131 | ||
132 | // TODO(iphydf): Don't rely on toxcore internals. | ||
133 | Messenger *m; | ||
134 | m = *(Messenger **)tox; | ||
135 | |||
133 | if (m->msi_packet) { | 136 | if (m->msi_packet) { |
134 | rc = TOXAV_ERR_NEW_MULTIPLE; | 137 | rc = TOXAV_ERR_NEW_MULTIPLE; |
135 | goto END; | 138 | goto END; |