shithub: sox

Download patch

ref: ac433fe7b90cfb22b88b2d99fbe3f2abfd165e34
parent: a35a2ebbf60bbff555116dab7119639bc42537ba
author: robs <robs>
date: Tue Mar 17 16:21:48 EDT 2009

fix mp3 read being up to a buffer short

--- a/src/mp3.c
+++ b/src/mp3.c
@@ -288,8 +288,10 @@
         /* check whether input buffer needs a refill */
         if (p->Stream.error == MAD_ERROR_BUFLEN)
         {
-            if (sox_mp3_input(ft) == SOX_EOF)
-                return 0;
+            if (sox_mp3_input(ft) == SOX_EOF) {
+                lsx_debug("sox_mp3_input EOF");
+                break;
+            }
         }
 
         if (mad_frame_decode(&p->Frame,&p->Stream))
@@ -307,7 +309,7 @@
                 {
                     lsx_report("unrecoverable frame level error (%s).",
                               mad_stream_errorstr(&p->Stream));
-                    return done;
+                    break;
                 }
             }
         }