aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Bouthenot <misc@atomas.com>2020-01-08 19:47:55 +0100
committerPaul B Mahol <onemda@gmail.com>2020-01-10 12:02:13 +0100
commit929e5159bc13da374b83f5627879c607acce180b (patch)
treed4dcd9b82aaa88f35ad353bd61d658eaf6575a39
parent3d894db700cc1e360a7a75ab9ac8bf67ac6670a3 (diff)
downloadffmpeg-929e5159bc13da374b83f5627879c607acce180b.tar.gz
avformat/id3v2enc: fix bad ID3v2 tag length
-rw-r--r--libavformat/id3v2enc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/id3v2enc.c b/libavformat/id3v2enc.c
index ee0c4b28a1..5d821ea4db 100644
--- a/libavformat/id3v2enc.c
+++ b/libavformat/id3v2enc.c
@@ -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);