crash fix for broken files

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6811 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2004-02-29 18:46:50 +00:00
parent fd8c0a5cca
commit e4e48cc279
3 changed files with 13 additions and 0 deletions
@@ -89,6 +89,10 @@ aiffReader::Sniff(int32 *streamCount)
return B_ERROR;
}
pos += sizeof(chunk);
if (UINT32(chunk.chunk_size) == 0) {
TRACE("aiffReader::Sniff: Error: chunk of size 0 found\n");
return B_ERROR;
}
switch (UINT32(chunk.chunk_id)) {
case FOURCC('C','O','M','M'):
{
@@ -142,6 +142,11 @@ OpenDMLParser::Parse(BPositionIO *source)
}
pos += 4;
size = AVI_UINT32(temp);
if (size == 0) {
TRACE("OpenDMLParser::Parse: Error: chunk of size 0 found\n");
goto err;
}
if (fourcc == FOURCC('J','U','N','K')) {
TRACE("OpenDMLParser::Parse: JUNK chunk ignored, size: %lu bytes\n", size);
@@ -100,6 +100,10 @@ WavReader::Sniff(int32 *streamCount)
return B_ERROR;
}
pos += sizeof(chunk);
if (UINT32(chunk.len) == 0) {
TRACE("WavReader::Sniff: Error: chunk of size 0 found\n");
return B_ERROR;
}
switch (UINT32(chunk.fourcc)) {
case FOURCC('f','m','t',' '):
if (UINT32(chunk.len) >= sizeof(format)) {