Permalink
Browse files

flac_decode: fail if Ogg packet length is too short

when parsing header
For Mozilla bug 480014

git-svn-id: http://svn.annodex.net/libfishsound/trunk@3888 8158c8cd-e7e1-0310-9fa4-c5954c97daef
  • Loading branch information...
conrad
conrad committed Mar 19, 2009
1 parent 9bee428 commit 91548c9a14a34345e89f3228a029c9461d2485ea
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/libfishsound/flac.c
View
@@ -237,6 +237,8 @@ static void*
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];

0 comments on commit 91548c9

Please sign in to comment.