X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavutil%2Favstring.c;h=e75cdc6312022fc3523ddf3ab67daca6549ee1c8;hb=2548f8a237b1ef85d1b56a897e93d5af206e4654;hp=f4374fdc74ba623f42a052deba6a74c3ae997a3c;hpb=4899ccd29572f139b0da648212595d3affc9bf5d;p=ffmpeg diff --git a/libavutil/avstring.c b/libavutil/avstring.c index f4374fdc74b..e75cdc63120 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;