mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 08:05:56 -05:00
[transcode] Fix illegal write when *icy_timer is null (fixes issue #412)
This commit is contained in:
parent
2d3d641f41
commit
43abb18e4e
@ -1490,7 +1490,8 @@ transcode(struct evbuffer *evbuf, int *icy_timer, struct transcode_ctx *ctx, int
|
||||
int processed;
|
||||
int ret;
|
||||
|
||||
*icy_timer = 0;
|
||||
if (icy_timer)
|
||||
*icy_timer = 0;
|
||||
|
||||
processed = 0;
|
||||
while (processed < want_bytes)
|
||||
@ -1508,7 +1509,7 @@ transcode(struct evbuffer *evbuf, int *icy_timer, struct transcode_ctx *ctx, int
|
||||
}
|
||||
|
||||
ctx->encode_ctx->total_bytes += processed;
|
||||
if (ctx->encode_ctx->icy_interval)
|
||||
if (icy_timer && ctx->encode_ctx->icy_interval)
|
||||
*icy_timer = (ctx->encode_ctx->total_bytes % ctx->encode_ctx->icy_interval < processed);
|
||||
|
||||
return processed;
|
||||
|
Loading…
Reference in New Issue
Block a user