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

Ivan Kalvachev ivan at cacad.com
Wed Nov 19 00:05:10 CET 2003


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;



More information about the MPlayer-dev-eng mailing list