[FFmpeg-cvslog] avformat/riffenc: Use size_t for strlen in ff_riff_write_info_tag()

Michael Niedermayer git at videolan.org
Tue May 12 15:14:06 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May 12 13:36:54 2015 +0200| [c3671e1d5760d79c083e7565d951f4628c06cf41] | committer: Michael Niedermayer

avformat/riffenc: Use size_t for strlen in ff_riff_write_info_tag()

Also dont generated corrupted output for larger than 4gb strings

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/riffenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index a629b8a..d429df0 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -269,8 +269,8 @@ void ff_parse_specific_params(AVStream *st, int *au_rate,
 
 void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str)
 {
-    int len = strlen(str);
-    if (len > 0) {
+    size_t len = strlen(str);
+    if (len > 0 && len < UINT32_MAX) {
         len++;
         ffio_wfourcc(pb, tag);
         avio_wl32(pb, len);



More information about the ffmpeg-cvslog mailing list