[MPlayer-dev-eng] [PATCH] String/memory handling in libao/audio_dec.c

Moritz Bunkus moritz at bunkus.org
Wed Oct 13 09:03:39 CEST 2004


Hey,

I don't know the code in question at all so this code could be OK.

This looks fishy:

>  	ao_subdevice=strchr(ao,':');
>  	if(ao_subdevice){
> -	    ao_subdevice[0]=0;
> -	    ++ao_subdevice;
> +	    ao_len = ao_subdevice - ao;
> +	    ao_subdevice = strdup(&ao[ao_len + 1]);
>  	}
> +	else
> +	    ao_len = strlen(ao);

...

> +    if (ao_subdevice) {
> +      free(ao_subdevice);
> +      ao_subdevice = NULL;
> +    }

Mosu

-- 
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds




More information about the MPlayer-dev-eng mailing list