]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mp4.c
mp4: Check the return value of ->truncate().
[paraslash.git] / mp4.c
diff --git a/mp4.c b/mp4.c
index 9ed0fcbb4dfbfaa07b53893e7e021607a17636ad..0bddac9c2f512c4cf8a6e1ef0f6f3aed044b8a21 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -882,8 +882,9 @@ int mp4_meta_update(struct mp4 *f)
        ret = write_data(f, new_moov_data, new_moov_size);
        if (ret < 0)
                goto free_moov;
-       f->cb->truncate(f->cb->user_data);
-       ret = 1;
+       ret = f->cb->truncate(f->cb->user_data);
+       if (ret < 0)
+               ret = -ERRNO_TO_PARA_ERROR(errno);
 free_moov:
        free(new_moov_data);
        return ret;