diff mbox series

[FFmpeg-devel,1/5] avformat/wtvdec: Don't truncate GUIDs

Message ID AS8P250MB0744C21B870FEA301D5BCE5B8FF1A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit c461ee39f941a9d50dbbec9a704d8c739912dcdb
Headers show
Series [FFmpeg-devel,1/5] avformat/wtvdec: Don't truncate GUIDs | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 12, 2023, 12:27 p.m. UTC
Each of the 16 bytes of a GUID is written as a two-character
hex value and three hyphens, leading to a length of 35.
GCC 13 emits a -Wformat-truncation= warning because of this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Is there actually a reason this is using a different format than
the one used by lavu/uuid.h?

 libavformat/wtvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Ross Sept. 12, 2023, 9:28 p.m. UTC | #1
On Tue, Sep 12, 2023 at 02:27:17PM +0200, Andreas Rheinhardt wrote:
> Each of the 16 bytes of a GUID is written as a two-character
> hex value and three hyphens, leading to a length of 35.
> GCC 13 emits a -Wformat-truncation= warning because of this.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> Is there actually a reason this is using a different format than
> the one used by lavu/uuid.h?

i don't think so. wtvdec predates lavu/uuid.h.

patchset looks good.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
diff mbox series

Patch

diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index b29ea7a923..1103f5ba03 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -43,7 +43,7 @@ 
     "%08"PRIx32"-%04"PRIx16"-%04"PRIx16"-%02x%02x%02x%02x%02x%02x%02x%02x"
 #define ARG_PRETTY_GUID(g) \
     AV_RL32(g),AV_RL16(g+4),AV_RL16(g+6),g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]
-#define LEN_PRETTY_GUID 34
+#define LEN_PRETTY_GUID 35
 
 /*
  * File system routines