Mans Rullgard <m...@mansr.com> wrote:
> +++ b/src/hcom.c
> @@ -432,9 +432,10 @@ static int stopwrite(sox_format_t * ft)
>    int rc = SOX_SUCCESS;
>  
>    /* Compress it all at once */
> -  if (compressed_len)
> +  if (compressed_len) {
>      compress(ft, &compressed_data, (int32_t *)&compressed_len);
> -  free(p->data);
> +    free(p->data);
> +  }

Tested successfully with: sox $INPUT x.hcom trim 0

A side note: As somebody who has never heard of hcom until now, much
less read the code, it was not immediately obvious to me what the
problem was or whether it introduced a new leaks until I skimmed through
the entire stopwrite and compress functions :x

------------------------------------------------------------------------------
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

Reply via email to