sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* [PATCH 0/5] Various bug fixes
@ 2018-04-26 21:10 Mans Rullgard
  2018-04-26 21:10 ` [PATCH 1/5] Added $(DESTDIR) in front of ${bindir} so proper sox binary is invoked during tests Mans Rullgard
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Mans Rullgard @ 2018-04-26 21:10 UTC (permalink / raw)
  To: sox-devel

A few easy pickings from the bug tracker.  Please review.

Jiri Kucera (1):
  Added $(DESTDIR) in front of ${bindir} so proper sox binary is invoked
    during tests

Mans Rullgard (4):
  update FSF mailing address
  oss: fix input buffer overrun
  amr: check for invalid block types
  aiff: fix handling of unknown odd-sized chunks

 src/Makefile.am |  4 ++--
 src/aiff.c      |  2 ++
 src/amr.h       | 15 ++++++++++++---
 src/ladspa.h    |  2 +-
 src/oss.c       |  2 +-
 test/corr.c     |  2 +-
 test/ltest.pl   |  2 +-
 test/model.c    |  2 +-
 test/wtest.pl   |  2 +-
 9 files changed, 22 insertions(+), 11 deletions(-)

-- 
2.17.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] Added $(DESTDIR) in front of ${bindir} so proper sox binary is invoked during tests
  2018-04-26 21:10 [PATCH 0/5] Various bug fixes Mans Rullgard
@ 2018-04-26 21:10 ` Mans Rullgard
  2018-04-26 21:10 ` [PATCH 2/5] update FSF mailing address Mans Rullgard
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Mans Rullgard @ 2018-04-26 21:10 UTC (permalink / raw)
  To: sox-devel

From: Jiri Kucera <jkucera@redhat.com>

---
 src/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 7cceaafdfbf7..caf986457ef1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -194,6 +194,6 @@ loc:
 # would run the test suite, but an uninstalled libltdl build cannot
 # currently load its formats and effects, so the checks would fail.
 installcheck:
-	$(srcdir)/tests.sh --bindir=${bindir} --builddir=${builddir} --srcdir=${srcdir}
-	$(srcdir)/testall.sh --bindir=${bindir} --srcdir=${srcdir}
+	$(srcdir)/tests.sh --bindir=$(DESTDIR)${bindir} --builddir=${builddir} --srcdir=${srcdir}
+	$(srcdir)/testall.sh --bindir=$(DESTDIR)${bindir} --srcdir=${srcdir}
 
-- 
2.17.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] update FSF mailing address
  2018-04-26 21:10 [PATCH 0/5] Various bug fixes Mans Rullgard
  2018-04-26 21:10 ` [PATCH 1/5] Added $(DESTDIR) in front of ${bindir} so proper sox binary is invoked during tests Mans Rullgard
@ 2018-04-26 21:10 ` Mans Rullgard
  2018-04-26 21:10 ` [PATCH 3/5] oss: fix input buffer overrun Mans Rullgard
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Mans Rullgard @ 2018-04-26 21:10 UTC (permalink / raw)
  To: sox-devel

---
 src/ladspa.h  | 2 +-
 test/corr.c   | 2 +-
 test/ltest.pl | 2 +-
 test/model.c  | 2 +-
 test/wtest.pl | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/ladspa.h b/src/ladspa.h
index 5c30a8a4b5c0..72c1c00a3b56 100644
--- a/src/ladspa.h
+++ b/src/ladspa.h
@@ -16,7 +16,7 @@
    
    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
    USA. */
 
 #ifndef LADSPA_INCLUDED
diff --git a/test/corr.c b/test/corr.c
index d747de53f4f0..8e81acb5129f 100644
--- a/test/corr.c
+++ b/test/corr.c
@@ -16,7 +16,7 @@
 
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  
 */
 
diff --git a/test/ltest.pl b/test/ltest.pl
index 2fba097278aa..7a74a33eb69a 100755
--- a/test/ltest.pl
+++ b/test/ltest.pl
@@ -16,7 +16,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 use strict;
 $|=1;
diff --git a/test/model.c b/test/model.c
index d29fb3ae71de..e4936b0a8590 100644
--- a/test/model.c
+++ b/test/model.c
@@ -15,7 +15,7 @@
 
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  
 */
 
diff --git a/test/wtest.pl b/test/wtest.pl
index d7affd34c279..0a7cdc80c4a7 100755
--- a/test/wtest.pl
+++ b/test/wtest.pl
@@ -16,7 +16,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 use strict;
 $|=1;
-- 
2.17.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] oss: fix input buffer overrun
  2018-04-26 21:10 [PATCH 0/5] Various bug fixes Mans Rullgard
  2018-04-26 21:10 ` [PATCH 1/5] Added $(DESTDIR) in front of ${bindir} so proper sox binary is invoked during tests Mans Rullgard
  2018-04-26 21:10 ` [PATCH 2/5] update FSF mailing address Mans Rullgard
@ 2018-04-26 21:10 ` Mans Rullgard
  2018-04-26 21:10 ` [PATCH 4/5] amr: check for invalid block types Mans Rullgard
  2018-04-26 21:10 ` [PATCH 5/5] aiff: fix handling of unknown odd-sized chunks Mans Rullgard
  4 siblings, 0 replies; 7+ messages in thread
From: Mans Rullgard @ 2018-04-26 21:10 UTC (permalink / raw)
  To: sox-devel

---
 src/oss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/oss.c b/src/oss.c
index 8292b584eb4f..9b13dc2f9a1a 100644
--- a/src/oss.c
+++ b/src/oss.c
@@ -369,7 +369,7 @@ static size_t osswrite(
         size_t cbStride;
         int cbWritten;
 
-        cStride = cInput;
+        cStride = cInputRemaining;
         if (cStride > pPriv->cOutput) {
             cStride = pPriv->cOutput;
         }
-- 
2.17.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] amr: check for invalid block types
  2018-04-26 21:10 [PATCH 0/5] Various bug fixes Mans Rullgard
                   ` (2 preceding siblings ...)
  2018-04-26 21:10 ` [PATCH 3/5] oss: fix input buffer overrun Mans Rullgard
@ 2018-04-26 21:10 ` Mans Rullgard
  2018-04-28  0:24   ` Eric Wong
  2018-04-26 21:10 ` [PATCH 5/5] aiff: fix handling of unknown odd-sized chunks Mans Rullgard
  4 siblings, 1 reply; 7+ messages in thread
From: Mans Rullgard @ 2018-04-26 21:10 UTC (permalink / raw)
  To: sox-devel

This fixes infinte loops and crashes with invalid inputs.
---
 src/amr.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/amr.h b/src/amr.h
index 900bb94e0f5a..c7ea9553263a 100644
--- a/src/amr.h
+++ b/src/amr.h
@@ -74,13 +74,18 @@ typedef struct amr_priv_t {
 static size_t decode_1_frame(sox_format_t * ft)
 {
   priv_t * p = (priv_t *)ft->priv;
-  size_t n_1;
+  size_t n;
   uint8_t coded[AMR_CODED_MAX];
 
   if (lsx_readbuf(ft, &coded[0], (size_t)1) != 1)
     return AMR_FRAME;
-  n_1 = amr_block_size[(coded[0] >> 3) & 0x0F] - 1;
-  if (lsx_readbuf(ft, &coded[1], n_1) != n_1)
+  n = amr_block_size[(coded[0] >> 3) & 0x0F];
+  if (!n) {
+    lsx_fail("invalid block type");
+    return AMR_FRAME;
+  }
+  n--;
+  if (lsx_readbuf(ft, &coded[1], n) != n)
     return AMR_FRAME;
   AMR_CALL(p, AmrOpencoreDecoderDecode, AmrGp3DecoderDecode, (p->state, coded, p->pcm, 0));
   return 0;
@@ -160,6 +165,10 @@ static size_t amr_duration_frames(sox_format_t * ft)
 
   for (frames = 0; lsx_readbuf(ft, &coded, (size_t)1) == 1; ++frames) {
     frame_size = amr_block_size[coded >> 3 & 15];
+    if (!frame_size) {
+      lsx_fail("invalid block type");
+      break;
+    }
     if (lsx_seeki(ft, frame_size - 1, SEEK_CUR)) {
       lsx_fail("seek");
       break;
-- 
2.17.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] aiff: fix handling of unknown odd-sized chunks
  2018-04-26 21:10 [PATCH 0/5] Various bug fixes Mans Rullgard
                   ` (3 preceding siblings ...)
  2018-04-26 21:10 ` [PATCH 4/5] amr: check for invalid block types Mans Rullgard
@ 2018-04-26 21:10 ` Mans Rullgard
  4 siblings, 0 replies; 7+ messages in thread
From: Mans Rullgard @ 2018-04-26 21:10 UTC (permalink / raw)
  To: sox-devel

---
 src/aiff.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/aiff.c b/src/aiff.c
index 240d2e1fdf63..1f7838423587 100644
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -314,6 +314,8 @@ int lsx_aiffstartread(sox_format_t * ft)
       lsx_readdw(ft, &chunksize);
       if (lsx_eof(ft))
         break;
+      /* account for padding after odd-sized chunks */
+      chunksize += chunksize & 1;
       /* Skip the chunk using lsx_readb() so we may read
          from a pipe */
       while (chunksize-- > 0) {
-- 
2.17.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/5] amr: check for invalid block types
  2018-04-26 21:10 ` [PATCH 4/5] amr: check for invalid block types Mans Rullgard
@ 2018-04-28  0:24   ` Eric Wong
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Wong @ 2018-04-28  0:24 UTC (permalink / raw)
  To: sox-devel; +Cc: Mans Rullgard

Mans Rullgard <mans@mansr.com> wrote:
> This fixes infinte loops and crashes with invalid inputs.

s/infinte/infinite/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-04-28  0:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 21:10 [PATCH 0/5] Various bug fixes Mans Rullgard
2018-04-26 21:10 ` [PATCH 1/5] Added $(DESTDIR) in front of ${bindir} so proper sox binary is invoked during tests Mans Rullgard
2018-04-26 21:10 ` [PATCH 2/5] update FSF mailing address Mans Rullgard
2018-04-26 21:10 ` [PATCH 3/5] oss: fix input buffer overrun Mans Rullgard
2018-04-26 21:10 ` [PATCH 4/5] amr: check for invalid block types Mans Rullgard
2018-04-28  0:24   ` Eric Wong
2018-04-26 21:10 ` [PATCH 5/5] aiff: fix handling of unknown odd-sized chunks Mans Rullgard

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).