Commit fa4d2802 authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

Feature: Added support to parse flac pictures from blobs

parent a21369fa
......@@ -68,6 +68,7 @@ typedef struct {
const char * flac_picture_type_string(flac_picture_type type);
flac_picture_t * flac_picture_parse_from_base64(const char *str);
flac_picture_t * flac_picture_parse_from_blob(const void *in, size_t len);
void flac_picture_free(flac_picture_t *picture);
......
......@@ -208,6 +208,30 @@ flac_picture_t * flac_picture_parse_from_base64(const char *str)
return ret;
}
flac_picture_t * flac_picture_parse_from_blob(const void *in, size_t len)
{
flac_picture_t *ret;
void *data;
if (!in || !len)
return NULL;
data = calloc(1, len + 1);
if (!data)
return NULL;
memcpy(data, in, len);
ret = flac_picture_parse_eat(data, len);
if (!ret) {
free(data);
return NULL;
}
return ret;
}
void flac_picture_free(flac_picture_t *picture)
{
if (!picture)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment