aboutsummaryrefslogtreecommitdiffstats
path: root/src/icy_metadata.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/icy_metadata.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/icy_metadata.c b/src/icy_metadata.c
index 5049d2805..aa65b32ca 100644
--- a/src/icy_metadata.c
+++ b/src/icy_metadata.c
@@ -52,9 +52,11 @@ icy_reset(struct icy_metadata *im)
size_t
icy_data(struct icy_metadata *im, size_t length)
{
- assert(icy_defined(im));
assert(length > 0);
+ if (!icy_defined(im))
+ return length;
+
if (im->data_rest == 0)
return 0;
@@ -145,7 +147,7 @@ icy_meta(struct icy_metadata *im, const void *data, size_t length)
if (length > im->meta_size - im->meta_position)
length = im->meta_size - im->meta_position;
- memcpy(im->meta_data + im->meta_position, data, length);
+ memcpy(im->meta_data + im->meta_position, p, length);
im->meta_position += length;
if (p != data)