[FFmpeg-cvslog] avio_put_str16le: Print error message in case of invalid UTF8 input

Michael Niedermayer git at videolan.org
Wed Nov 13 19:24:02 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov 13 18:39:17 2013 +0100| [b52ae27edf392e5a0df95054d394d850b8e57d35] | committer: Michael Niedermayer

avio_put_str16le: Print error message in case of invalid UTF8 input

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

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

 libavformat/aviobuf.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index dc0ed71..d54564a 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -324,8 +324,11 @@ int avio_put_str16le(AVIOContext *s, const char *str)
         uint32_t ch;
         uint16_t tmp;
 
-        GET_UTF8(ch, *q++, break;)
+        GET_UTF8(ch, *q++, goto invalid;)
         PUT_UTF16(ch, tmp, avio_wl16(s, tmp); ret += 2;)
+        continue;
+invalid:
+        av_log(s, AV_LOG_ERROR, "Invaid UTF8 sequence in avio_put_str16le\n");
     }
     avio_wl16(s, 0);
     ret += 2;



More information about the ffmpeg-cvslog mailing list