提交 d60317c1 authored 作者: Raymond Chandler's avatar Raymond Chandler

FS-5091 --resolve avoid division by 0

上级 2dc3b47d
...@@ -208,6 +208,7 @@ static inline void free_context(shout_context_t *context) ...@@ -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,13 +223,16 @@ static inline void free_context(shout_context_t *context) ...@@ -222,13 +223,16 @@ static inline void free_context(shout_context_t *context)
} }
} }
while ((len = lame_encode_flush(context->gfp, mp3buffer, sizeof(mp3buffer))) > 0) { framesize = lame_get_framesize(context->gfp);
ret = shout_send(context->shout, mp3buffer, len); if ( framesize ) {
while ((len = lame_encode_flush(context->gfp, mp3buffer, sizeof(mp3buffer))) > 0) {
ret = shout_send(context->shout, mp3buffer, len);
if (ret != SHOUTERR_SUCCESS) { if (ret != SHOUTERR_SUCCESS) {
break; break;
} else { } else {
shout_sync(context->shout); shout_sync(context->shout);
}
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论