[MPlayer-dev-eng] [PATCH] fix a few warnings

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Jan 25 11:48:59 CET 2007


Hello,
On Thu, Jan 25, 2007 at 04:57:49AM +0100, Dominik 'Rathann' Mierzejewski wrote:
> Found this rotting in my patch queue.
> 
> One weird thing, though:
> 
> libmpdemux/demux_mov.c:
> @@ -1369,7 +1369,7 @@                                                                                                   
>             z_stream zstrm;
>             stream_t* backup;
> 
> -           if (moov_sz > SIZE_MAX - 16) {
> +           if (moov_sz > INT_MAX - 16) {
>                mp_msg(MSGT_DEMUX, MSGL_ERR, "Invalid cmvd atom size %d\n", moov_sz);
>                break;
>              }
> 
> With SIZE_MAX, I get "condition always false" or something like that.

IMO the former one is correct. Though this condition really is always
false on 64 bit systems. Changing the type of moov_sz from "unsigned
int" to size_t might be an acceptable workaround though if desired.
No obvious problems with the rest.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list