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