]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
aac_afh: Fix check of return value of mp4ff_meta_update().
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 13 Aug 2021 19:47:47 +0000 (21:47 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 Aug 2021 18:36:10 +0000 (20:36 +0200)
This function returns zero on failure, and one on success, so the
current check for a negative return value is incorrect. The call to
mp4ff_meta_get_by_index() suffers from the same mistake.

aac_afh.c

index 7f2a22a223ce733aa4b49d0a60ff63d1b95bf321..2b3dd2cc538a57a233813b77adcb332bd77929ce 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -292,8 +292,7 @@ static int aac_afh_rewrite_tags(const char *map, size_t mapsize,
                mp4ff_tag_t *tag = metadata.tags + i;
 
                ret = -E_MP4FF_META_READ;
-               if (mp4ff_meta_get_by_index(mp4ff, i,
-                               &tag->item, &tag->value) < 0)
+               if (!mp4ff_meta_get_by_index(mp4ff, i, &tag->item, &tag->value))
                        goto free_tags;
                PARA_INFO_LOG("found: %s: %s\n", tag->item, tag->value);
                if (!strcmp(tag->item, "artist"))
@@ -318,7 +317,7 @@ static int aac_afh_rewrite_tags(const char *map, size_t mapsize,
        if (!found_comment)
                add_tag(&metadata, "comment", tags->comment);
        ret = -E_MP4FF_META_WRITE;
-       if (mp4ff_meta_update(&cb, &metadata) < 0)
+       if (!mp4ff_meta_update(&cb, &metadata))
                goto free_tags;
        ret = 1;
 free_tags: