File 929e5159bc13da374b83f5627879c607acce180b.patch of Package A_tw-ffmpeg

33
 
1
From 929e5159bc13da374b83f5627879c607acce180b Mon Sep 17 00:00:00 2001
2
From: Gilles Bouthenot <misc@atomas.com>
3
Date: Wed, 8 Jan 2020 19:47:55 +0100
4
Subject: [PATCH] avformat/id3v2enc: fix bad ID3v2 tag length
5
6
---
7
 libavformat/id3v2enc.c | 6 +++---
8
 1 file changed, 3 insertions(+), 3 deletions(-)
9
10
Index: ffmpeg-4.2.1/libavformat/id3v2enc.c
11
===================================================================
12
--- ffmpeg-4.2.1.orig/libavformat/id3v2enc.c
13
+++ ffmpeg-4.2.1/libavformat/id3v2enc.c
14
@@ -268,15 +268,15 @@ static int write_ctoc(AVFormatContext *s
15
     if ((ret = avio_open_dyn_buf(&dyn_bc)) < 0)
16
         goto fail;
17
 
18
-    id3->len += avio_put_str(dyn_bc, "toc");
19
+    avio_put_str(dyn_bc, "toc");
20
     avio_w8(dyn_bc, 0x03);
21
     avio_w8(dyn_bc, s->nb_chapters);
22
     for (int i = 0; i < s->nb_chapters; i++) {
23
         snprintf(name, 122, "ch%d", i);
24
-        id3->len += avio_put_str(dyn_bc, name);
25
+        avio_put_str(dyn_bc, name);
26
     }
27
     len = avio_close_dyn_buf(dyn_bc, &dyn_buf);
28
-    id3->len += 16 + ID3v2_HEADER_SIZE;
29
+    id3->len += len + ID3v2_HEADER_SIZE;
30
 
31
     avio_wb32(s->pb, MKBETAG('C', 'T', 'O', 'C'));
32
     avio_wb32(s->pb, len);
33