summaryrefslogtreecommitdiff
path: root/libavformat/aviobuf.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-13 18:39:17 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-13 19:09:04 +0100
commitb52ae27edf392e5a0df95054d394d850b8e57d35 (patch)
treec90f7da049b2104ef68b2c431f1d96e27afa0a71 /libavformat/aviobuf.c
parent7561974dfee0f233433f05c1f77f97ec10796f35 (diff)
avio_put_str16le: Print error message in case of invalid UTF8 input
Found-by: Stefano Sabatini Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r--libavformat/aviobuf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index dc0ed717fd..d54564ab3d 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;