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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user