ANI loader: Avoid debug line when image does not have proper signature

This commit is contained in:
Kim Woelders 2024-01-01 16:04:32 +01:00
parent 06314730ff
commit 9ad4769e0a
1 changed files with 3 additions and 4 deletions

View File

@ -125,12 +125,8 @@ _riff_parse(ImlibImage * im, riff_ctx_t * ctx, const char *fdata,
type = SWAP_LE_32(chunk->hdr.type);
size = SWAP_LE_32(chunk->hdr.size);
D("%5lu: %*s Chunk: %.4s size %u: ",
OFFS(fptr), ctx->nest, "", fptr, size);
if (ctx->nest == 1 && fptr == fdata)
{
Dx("\n");
/* First chunk of file */
if (type != RIFF_TYPE_RIFF ||
(SWAP_LE_32(chunk->list.name)) != RIFF_NAME_ACON)
@ -139,6 +135,9 @@ _riff_parse(ImlibImage * im, riff_ctx_t * ctx, const char *fdata,
continue;
}
D("%5lu: %*s Chunk: %.4s size %u: ",
OFFS(fptr), ctx->nest, "", fptr, size);
if (avail < 8 + size)
{
Dx("incorrect size\n");