summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2021-05-20 14:07:46 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2021-05-20 14:07:46 +0100
commit2661e4414414e7c390f6fea20c258a83472afb82 (patch)
tree813c15651c86fa70d5c19200f4d2be56472b52c1
parentb831203c80955837596c708a2cbfa37dba31d05f (diff)
downloadlibmediaart-2661e4414414e7c390f6fea20c258a83472afb82.tar.gz
Don't use a field before setting it
We are using the data->len field in our g_memdup() call before we're actually setting it; since the data structure is zero-filled, it means we're not copying the buffer at all.
-rw-r--r--libmediaart/extract.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmediaart/extract.c b/libmediaart/extract.c
index d505285..bef8c0d 100644
--- a/libmediaart/extract.c
+++ b/libmediaart/extract.c
@@ -1366,8 +1366,8 @@ process_data_new (MediaArtType type,
data->uri = g_strdup (uri);
- data->buffer = g_memdup (buffer, data->len);
data->len = len;
+ data->buffer = g_memdup (buffer, data->len);
data->mime = g_strdup (mime);
data->artist = g_strdup (artist);