[vlc-commits] Ogg: fix off-by-one overflow
Rémi Denis-Courmont
git at videolan.org
Sat Jun 4 21:11:16 CEST 2011
vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun 4 22:10:15 2011 +0300| [4df0431d37de35effdd34ef7c5619606ebc93831] | committer: Rémi Denis-Courmont
Ogg: fix off-by-one overflow
(cherry picked from commit b38b9c24c20313bfa3fa76fe7dffa6177edd270e)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=4df0431d37de35effdd34ef7c5619606ebc93831
---
modules/mux/ogg.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c
index 0d36a26..7e902f0 100644
--- a/modules/mux/ogg.c
+++ b/modules/mux/ogg.c
@@ -417,7 +417,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
memcpy( p_stream->p_oggds_header->stream_type, "audio", 5 );
memset( p_stream->p_oggds_header->sub_type, 0, 4 );
- sprintf( p_stream->p_oggds_header->sub_type, "%-x", i_tag );
+ char buf[5];
+ snprintf( buf, sizeof(buf), "%"PRIx16, i_tag );
+ strncpy( p_stream->p_oggds_header->sub_type, buf, 4 );
SetQWLE( &p_stream->p_oggds_header->i_time_unit, INT64_C(10000000) );
SetDWLE( &p_stream->p_oggds_header->i_default_len, 1 );
More information about the vlc-commits
mailing list