[xiph-commits] r18952 - experimental/giles

giles at svn.xiph.org giles at svn.xiph.org
Mon May 27 12:57:26 PDT 2013


Author: giles
Date: 2013-05-27 12:57:26 -0700 (Mon, 27 May 2013)
New Revision: 18952

Modified:
   experimental/giles/mp3dump.c
Log:
Skip files when we can't calculate frame sizes.

Some headers can parse to a zero bitrate, which means
we could never skip to the next packet. Abort parsing
if we get too small a frame size instead of looping
forever.


Modified: experimental/giles/mp3dump.c
===================================================================
--- experimental/giles/mp3dump.c	2013-05-20 14:18:40 UTC (rev 18951)
+++ experimental/giles/mp3dump.c	2013-05-27 19:57:26 UTC (rev 18952)
@@ -187,6 +187,10 @@
       if (p - q) fprintf(out, "LOST SYNC\n");
       parse(p, &header);
       skip = framesize(&header);
+      if (skip <= 4) {
+        fprintf(out, " can't calculate frame size\n");
+        break;
+      }
       fprintf(out, " mp3 header at 0x%08lx (%ld bytes)\n",
 	(long)(p-buf), skip);
       dump_header(&header, out);



More information about the commits mailing list