shithub: sox

Download patch

ref: d29ccbd174370fdd9575f8217d8dfc1b919f51f6
parent: 557ba98586f8a42923ae1a0c7ec2d7a208c0185c
author: robs <robs>
date: Fri Oct 26 06:49:11 EDT 2007

stop fooling FORTIFY_SOURCE

--- a/src/sf.c
+++ b/src/sf.c
@@ -37,7 +37,7 @@
         sox_bool finished = sox_false;
         SFCODE *sfcodep;
 
-        sfcodep = (SFCODE *) &sfcodes(sfhead);
+        sfcodep = (SFCODE *) (&sfhead->sfinfo + 1);
         do {
                 sfcharp = (char *) sfcodep + sizeof(SFCODE);
                 if (ft->signal.reverse_bytes) {
@@ -199,7 +199,7 @@
         /* between different coverts and not rely on memory contents */
         memset (&sfhead, 0, sizeof(SFHEADER));
         memcpy(&sfhead.sfinfo, &sf->info, sizeof(struct sfinfo));
-        sfcodep = (SFCODE *) &sfcodes(&sfhead);
+        sfcodep = (SFCODE *) (&sfhead.sfinfo + 1);
         sfcodep->code = SF_COMMENT;
         sfcodep->bsize = strlen(ft->comment) + sizeof(SFCODE);
         while (sfcodep->bsize % 4)
--- a/src/sfircam.h
+++ b/src/sfircam.h
@@ -93,7 +93,6 @@
     float     sf_srate;
     uint32_t          sf_chans;
     uint32_t          sf_packmode;
-    char      sf_codes;
 };
 
 typedef union sfheader {
@@ -160,7 +159,6 @@
 #define sfclass(x) ((x)->sfinfo.sf_packmode)
 #define sfsamplesize(x) ((size_t) ((x)->sfinfo.sf_packmode & 0xFFFF))
 #define sfbsize(x) ((x)->sox_size - sizeof(SFHEADER))
-#define sfcodes(x) ((x)->sfinfo.sf_codes)
 
 /*
  * Macros for testing soundfiles