]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/aviobuf.c
Merge commit 'fec76cd430f3c865183a6e5b4caec0743e055605'
[ffmpeg] / libavformat / aviobuf.c
index c2aa8dc96e2ad2e4069b40edd69b74dcfa4f6e9a..b56d113e02883c95d6f29ad5388332a5017eb13a 100644 (file)
@@ -361,6 +361,8 @@ static inline int put_str16(AVIOContext *s, const char *str, const int be)
 invalid:
         av_log(s, AV_LOG_ERROR, "Invaid UTF8 sequence in avio_put_str16%s\n", be ? "be" : "le");
         err = AVERROR(EINVAL);
+        if (!*(q-1))
+            break;
     }
     if (be)
         avio_wb16(s, 0);
@@ -968,7 +970,7 @@ int avio_closep(AVIOContext **s)
 int avio_printf(AVIOContext *s, const char *fmt, ...)
 {
     va_list ap;
-    char buf[4096];
+    char buf[4096]; /* update doc entry in avio.h if changed */
     int ret;
 
     va_start(ap, fmt);