Skip to content

Not all uses of new[] for file inputs are wrapped in "bad_alloc" catches #630

@solidpixel

Description

@solidpixel

Corrupt image files can request silly amounts of memory even if they don't overflow a size_t, which generally causes a bad_alloc to be thrown by new[]. This is not reliably caught today, and in some cases can propagate to the end of main() and causes an ugly error to get printed. Hoist a single check for those somewhere in common code that can catch all input image allocations.

Need to catch:

  • load_cimage
  • load_ncimage
  • load_ktx_compressed_image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions