[vlc-commits] mp4: meta: fix format-truncation warning

Alexandre Janniaux git at videolan.org
Wed Sep 11 09:44:44 CEST 2019


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Thu Sep  5 00:25:22 2019 +0200| [d34040a3d32d24f7b4218bb79ec28482b1906115] | committer: Thomas Guillem

mp4: meta: fix format-truncation warning

PRIu16 can go up to 65535, so it's 6 char when counting the null one.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d34040a3d32d24f7b4218bb79ec28482b1906115
---

 modules/demux/mp4/meta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mp4/meta.c b/modules/demux/mp4/meta.c
index bf4ed2a88f..3288549244 100644
--- a/modules/demux/mp4/meta.c
+++ b/modules/demux/mp4/meta.c
@@ -394,7 +394,7 @@ static void SetupmdirMeta( vlc_meta_t *p_meta, MP4_Box_t *p_box )
         if ( BOXDATA(p_data)->i_blob >= 6 &&
              BOXDATA(p_data)->e_wellknowntype == DATA_WKT_RESERVED )
         {
-            char psz_number[5];
+            char psz_number[6];
             snprintf( psz_number, sizeof( psz_number ), "%"PRIu16, GetWBE(&BOXDATA(p_data)->p_blob[2]) );
             vlc_meta_Set( p_meta, vlc_meta_DiscNumber, psz_number );
             snprintf( psz_number, sizeof( psz_number ), "%"PRIu16, GetWBE(&BOXDATA(p_data)->p_blob[4]) );



More information about the vlc-commits mailing list