diff --git a/apps/app_milliwatt.c b/apps/app_milliwatt.c index e9266a6835..fa2c03e8cc 100644 --- a/apps/app_milliwatt.c +++ b/apps/app_milliwatt.c @@ -77,7 +77,7 @@ static void milliwatt_release(struct ast_channel *chan, void *data) static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int samples) { unsigned char buf[AST_FRIENDLY_OFFSET + 640]; - const int maxsamples = sizeof (buf) / sizeof (buf[0]); + const int maxsamples = (sizeof (buf) / sizeof (buf[0])) - (AST_FRIENDLY_OFFSET / sizeof(buf[0])); int i, *indexp = (int *) data; struct ast_frame wf = { .frametype = AST_FRAME_VOICE,