[xiph-commits] r3888 - libfishsound/trunk/src/libfishsound

conrad at svn.annodex.net conrad at svn.annodex.net
Thu Mar 19 00:44:42 PDT 2009


Author: conrad
Date: 2009-03-19 00:44:41 -0700 (Thu, 19 Mar 2009)
New Revision: 3888

Modified:
   libfishsound/trunk/src/libfishsound/flac.c
Log:
flac_decode: fail if Ogg packet length is too short
when parsing header
For Mozilla bug 480014

Modified: libfishsound/trunk/src/libfishsound/flac.c
===================================================================
--- libfishsound/trunk/src/libfishsound/flac.c	2009-03-19 06:29:03 UTC (rev 3887)
+++ libfishsound/trunk/src/libfishsound/flac.c	2009-03-19 07:44:41 UTC (rev 3888)
@@ -237,6 +237,8 @@
 fs_flac_decode_header (FishSound * fsound, unsigned char *buf, long bytes)
 {
   FishSoundFlacInfo *fi = fsound->codec_data;
+
+  if (bytes < 9) return NULL;
   if (buf[0] != 0x7f) return NULL;
   if (strncmp((char *)buf+1, "FLAC", 4) != 0) return NULL;
   fi->version.major = buf[5];



More information about the commits mailing list