aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-12 20:01:33 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2014-04-16 19:20:20 +0200
commit56f44c26f06a8d86e6768810d5c389de4671913a (patch)
treec06048eab64dd51d143ee5e30cc44fa845e6aad5
parentfe87a40de6792ee97686ce4a215268041e3fcf81 (diff)
downloadffmpeg-56f44c26f06a8d86e6768810d5c389de4671913a.tar.gz
avutil/avstring: do not lose ascii characters when decoding non utf-8 with av_utf8_decode()
Fixes Ticket3363 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit a31547ce2e5c46d7a7005fe70dcf9b3a7c5fc4ac)
-rw-r--r--libavutil/avstring.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index f4374fdc74..e75cdc6312 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -331,15 +331,15 @@ int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end,
while (code & top) {
int tmp;
if (p >= buf_end) {
- ret = AVERROR(EILSEQ); /* incomplete sequence */
- goto end;
+ (*bufp) ++;
+ return AVERROR(EILSEQ); /* incomplete sequence */
}
/* we assume the byte to be in the form 10xx-xxxx */
tmp = *p++ - 128; /* strip leading 1 */
if (tmp>>6) {
- ret = AVERROR(EILSEQ);
- goto end;
+ (*bufp) ++;
+ return AVERROR(EILSEQ);
}
code = (code<<6) + tmp;
top <<= 5;