[FFmpeg-devel] [PATCH 1/2] lavu: fix GET_UTF8 macro.

Michael Niedermayer michaelni at gmx.at
Mon Apr 22 01:22:29 CEST 2013


On Sun, Apr 21, 2013 at 05:25:48PM +0200, Nicolas George wrote:
> Prevent 0xFE and 0xFF from being considered the start of
> non-standard 7-bytes sequences. No noticeable effect on speed.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavutil/common.h  |    2 +-
>  libavutil/version.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> 
> New version of the series, after the discussion with Reimar.
> 
> 
> diff --git a/libavutil/common.h b/libavutil/common.h
> index e303c25..13f2ffb 100644
> --- a/libavutil/common.h
> +++ b/libavutil/common.h
> @@ -297,7 +297,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
>      val= GET_BYTE;\
>      {\
>          uint32_t top = (val & 128) >> 1;\
> -        if ((val & 0xc0) == 0x80)\
> +        if ((val & 0xc0) == 0x80 || val >= 0xFE)\
>              ERROR\
>          while (val & top) {\
>              int tmp= GET_BYTE - 128;\

should be ok, but i didnt check the unicode specs (i guess you did
already)


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130422/7e69a45d/attachment.asc>


More information about the ffmpeg-devel mailing list