mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-02 11:29:48 +00:00
FS-5091 --resolve avoid division by 0
This commit is contained in:
parent
2dc3b47db1
commit
d60317c153
@ -208,6 +208,7 @@ static inline void free_context(shout_context_t *context)
|
|||||||
unsigned char mp3buffer[8192];
|
unsigned char mp3buffer[8192];
|
||||||
int len;
|
int len;
|
||||||
int16_t blank[2048] = { 0 }, *r = NULL;
|
int16_t blank[2048] = { 0 }, *r = NULL;
|
||||||
|
int framesize;
|
||||||
|
|
||||||
if (context->channels == 2) {
|
if (context->channels == 2) {
|
||||||
r = blank;
|
r = blank;
|
||||||
@ -222,6 +223,8 @@ static inline void free_context(shout_context_t *context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
framesize = lame_get_framesize(context->gfp);
|
||||||
|
if ( framesize ) {
|
||||||
while ((len = lame_encode_flush(context->gfp, mp3buffer, sizeof(mp3buffer))) > 0) {
|
while ((len = lame_encode_flush(context->gfp, mp3buffer, sizeof(mp3buffer))) > 0) {
|
||||||
ret = shout_send(context->shout, mp3buffer, len);
|
ret = shout_send(context->shout, mp3buffer, len);
|
||||||
|
|
||||||
@ -232,6 +235,7 @@ static inline void free_context(shout_context_t *context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
shout_close(context->shout);
|
shout_close(context->shout);
|
||||||
context->shout = NULL;
|
context->shout = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user