]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/id3v2enc.c
avfilter/vf_scale: store the offset in a local variable before adding it
[ffmpeg] / libavformat / id3v2enc.c
index ee0c4b28a19060bbe3e60a541f9d4f433d6b151a..5d821ea4db247754c5fe90c47e9c3b3ea0169b7e 100644 (file)
@@ -268,15 +268,15 @@ static int write_ctoc(AVFormatContext *s, ID3v2EncContext *id3, int enc)
     if ((ret = avio_open_dyn_buf(&dyn_bc)) < 0)
         return ret;
 
-    id3->len += avio_put_str(dyn_bc, "toc");
+    avio_put_str(dyn_bc, "toc");
     avio_w8(dyn_bc, 0x03);
     avio_w8(dyn_bc, s->nb_chapters);
     for (int i = 0; i < s->nb_chapters; i++) {
         snprintf(name, 122, "ch%d", i);
-        id3->len += avio_put_str(dyn_bc, name);
+        avio_put_str(dyn_bc, name);
     }
     len = avio_get_dyn_buf(dyn_bc, &dyn_buf);
-    id3->len += 16 + ID3v2_HEADER_SIZE;
+    id3->len += len + ID3v2_HEADER_SIZE;
 
     avio_wb32(s->pb, MKBETAG('C', 'T', 'O', 'C'));
     avio_wb32(s->pb, len);