[FFmpeg-cvslog] r12258 - trunk/libavformat/matroskaenc.c

Rich Felker dalias
Wed Feb 27 03:44:22 CET 2008


On Wed, Feb 27, 2008 at 01:53:34AM +0100, aurel wrote:
> Author: aurel
> Date: Wed Feb 27 01:53:34 2008
> New Revision: 12258
> 
> Log:
> makes really sure that no undefined behavior can happen
> 
> Modified:
>    trunk/libavformat/matroskaenc.c
> 
> Modified: trunk/libavformat/matroskaenc.c
> ==============================================================================
> --- trunk/libavformat/matroskaenc.c	(original)
> +++ trunk/libavformat/matroskaenc.c	Wed Feb 27 01:53:34 2008
> @@ -149,7 +149,7 @@ static void put_ebml_num(ByteIOContext *
>  static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t val)
>  {
>      int i, bytes = 1;
> -    while (val >> bytes*8 && bytes < 8) bytes++;
> +    while (bytes < 8 && val >> bytes*8) bytes++;

uint64_t tmp = val;
while (tmp>>=8) bytes++;

Rich




More information about the ffmpeg-cvslog mailing list