shithub: sox

Download patch

ref: 18d2609a2362a43928d45bbd806b17ebd7fa8eb8
parent: 998208fd1c18fcbbf2a5bcabdbcec72649cfc387
author: Mans Rullgard <mans@mansr.com>
date: Sat Apr 28 14:53:46 EDT 2018

hcom: fix pointer type confusion [bug #308]

The compress() call fails on big endian systems with size_t bigger
than int32_t.  Fix by using the correct types.

--- a/src/hcom.c
+++ b/src/hcom.c
@@ -441,12 +441,12 @@
 {
   priv_t *p = (priv_t *) ft->priv;
   unsigned char *compressed_data = p->data;
-  size_t compressed_len = p->pos;
+  int32_t compressed_len = p->pos;
   int rc = SOX_SUCCESS;
 
   /* Compress it all at once */
   if (compressed_len) {
-    compress(ft, &compressed_data, (int32_t *)&compressed_len);
+    compress(ft, &compressed_data, &compressed_len);
     free(p->data);
   }