shithub: sox

Download patch

ref: f2d584540d541ebc1fb63268f52e7461110160fe
parent: 49c707cbb5a2e2c57f485905648002d8eaa32f19
author: cbagwell <cbagwell>
date: Wed Nov 28 22:52:37 EST 2001

fixed confusion when input files were to short (currupt files).

--- a/src/tx16w.c
+++ b/src/tx16w.c
@@ -83,7 +83,7 @@
   st_size_t num_samp_bytes = 0;
   char gunk[8];
   int blewIt;
-  int32_t trash;
+  uint32_t trash;
 
   txw_t sk = (txw_t) ft->priv;
   /* If you need to seek around the input file. */
@@ -218,7 +218,7 @@
 	 * deposit into the given buffer and adjust our counts respectivly.
          */
         for(done = 0; done < len; ) {
-	    if(sk->rest <= 0) break; /* Finished reading from file? */
+	    if(sk->rest < 3) break; /* Finished reading from file? */
 	    st_readb(ft, &uc1);
 	    st_readb(ft, &uc2);
 	    st_readb(ft, &uc3);