[MPlayer-dev-eng] spudec - few warnings :O

D Richard Felker III dalias at aerifal.cx
Wed Nov 19 05:11:26 CET 2003


On Wed, Nov 19, 2003 at 01:05:10AM +0200, Ivan Kalvachev wrote:
> Hi there,
>   today while i was compiling mplayer, i sow and very interesting warning:
> 
> spudec.c:657: warning: comparison of unsigned expression < 0 is always false
> spudec.c:667: warning: comparison of unsigned expression < 0 is always false
> 
> spudec.c:1078: warning: comparison of unsigned expression < 0 is always false
> spudec.c:1086: warning: comparison of unsigned expression < 0 is always false
> 
>   This is a bug, if unsigned variable get negative, it actually overlow
>   and get very big.
>   I haven't RTFS, and haven;t tried to fix the problem by myself.
>   probably not using unsigned would be a good idea, but i cannot
>   test it.
> 
>   Here are some extracted parts of the code
> 
> ## @80
>   unsigned int scaled_frame_width, scaled_frame_height;
>   unsigned int scaled_start_col, scaled_start_row;
> ...
> } spudec_handle_t;
> 
> ## @765
>   spudec_handle_t *spu = (spudec_handle_t *)me;
> 
> ## @1078
>             if (spu->scaled_start_row < 0) spu->scaled_start_row = 0;

IIRC those are my 1000l's, but I don't remember the code anymore and
I'm too busy to relearn it. If your fix looks right, it's probably
right..

Rich



More information about the MPlayer-dev-eng mailing list