From 871e7220515b21e1626968a4bde3547a9672f263 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 14 Aug 2021 22:53:39 +0200 Subject: [PATCH] mp4: Remove the membuffer error bit. Due to the previous cleanups, it is never set, so remove all code which checks whether the bit is set. --- mp4.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/mp4.c b/mp4.c index 76cc6737..869a6f6d 100644 --- a/mp4.c +++ b/mp4.c @@ -1143,7 +1143,6 @@ struct membuffer { void *data; unsigned written; unsigned allocated; - unsigned error; }; static struct membuffer *membuffer_create(void) @@ -1159,8 +1158,6 @@ static unsigned membuffer_write(struct membuffer *buf, const void *ptr, unsigned { unsigned dest_size = buf->written + bytes; - if (buf->error) - return 0; if (dest_size > buf->allocated) { do { buf->allocated <<= 1; @@ -1204,11 +1201,6 @@ static void membuffer_write_std_tag(struct membuffer *buf, const char *name, membuffer_write(buf, value, len); } -static unsigned membuffer_error(const struct membuffer *buf) -{ - return buf->error; -} - static void membuffer_free(struct membuffer *buf) { free(buf->data); @@ -1222,11 +1214,7 @@ static unsigned membuffer_get_size(const struct membuffer *buf) static void *membuffer_detach(struct membuffer *buf) { - void *ret; - - if (buf->error) - return 0; - ret = para_realloc(buf->data, buf->written); + void *ret = para_realloc(buf->data, buf->written); free(buf); return ret; } @@ -1266,11 +1254,6 @@ static uint32_t create_ilst(const struct mp4_metadata *meta, void **out_buffer, else PARA_ERROR_LOG("invalid tag item: %s\n", tag->item); } - if (membuffer_error(buf)) { - membuffer_free(buf); - return 0; - } - *out_size = membuffer_get_size(buf); *out_buffer = membuffer_detach(buf); return 1; -- 2.39.5