]> git.sesse.net Git - ffmpeg/commitdiff
avutil/avstring: do not lose ascii characters when decoding non utf-8 with av_utf8_de...
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 12 Apr 2014 18:01:33 +0000 (20:01 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Apr 2014 13:33:23 +0000 (15:33 +0200)
Fixes Ticket3363

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/avstring.c

index f4374fdc74ba623f42a052deba6a74c3ae997a3c..e75cdc6312022fc3523ddf3ab67daca6549ee1c8 100644 (file)
@@ -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;