HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Controls for internal safety checks

Functions

EXR_EXPORT void exr_set_default_maximum_image_size (int w, int h)
 Limit the size of image allowed to be parsed or created by the library. More...
 
EXR_EXPORT void exr_get_default_maximum_image_size (int *w, int *h)
 Retrieve the global default maximum image size. More...
 
EXR_EXPORT void exr_set_default_maximum_tile_size (int w, int h)
 Limit the size of an image tile allowed to be parsed or created by the library. More...
 
EXR_EXPORT void exr_get_default_maximum_tile_size (int *w, int *h)
 Retrieve the global maximum tile size. More...
 

Detailed Description

Function Documentation

EXR_EXPORT void exr_get_default_maximum_image_size ( int w,
int h 
)

Retrieve the global default maximum image size.

This function does not fail.

EXR_EXPORT void exr_get_default_maximum_tile_size ( int w,
int h 
)

Retrieve the global maximum tile size.

This function does not fail.

EXR_EXPORT void exr_set_default_maximum_image_size ( int  w,
int  h 
)

Limit the size of image allowed to be parsed or created by the library.

This is used as a safety check against corrupt files, but can also serve to avoid potential issues on machines which have very constrained RAM.

These values are among the only globals in the core layer of OpenEXR. The intended use is for applications to define a global default, which will be combined with the values provided to the individual context creation routine. The values are used to check against parsed header values. This adds some level of safety from memory overruns where a corrupt file given to the system may cause a large allocation to happen, enabling buffer overruns or other potential security issue.

These global values are combined with the values in exr_context_initializer_t using the following rules:

  1. negative values are ignored.
  2. if either value has a positive (non-zero) value, and the other has 0, the positive value is preferred.
  3. If both are positive (non-zero), the minimum value is used.
  4. If both values are 0, this disables the constrained size checks.

This function does not fail.

EXR_EXPORT void exr_set_default_maximum_tile_size ( int  w,
int  h 
)

Limit the size of an image tile allowed to be parsed or created by the library.

Similar to image size, this places constraints on the maximum tile size as a safety check against bad file data

This is used as a safety check against corrupt files, but can also serve to avoid potential issues on machines which have very constrained RAM

These values are among the only globals in the core layer of OpenEXR. The intended use is for applications to define a global default, which will be combined with the values provided to the individual context creation routine. The values are used to check against parsed header values. This adds some level of safety from memory overruns where a corrupt file given to the system may cause a large allocation to happen, enabling buffer overruns or other potential security issue.

These global values are combined with the values in exr_context_initializer_t using the following rules:

  1. negative values are ignored.
  2. if either value has a positive (non-zero) value, and the other has 0, the positive value is preferred.
  3. If both are positive (non-zero), the minimum value is used.
  4. If both values are 0, this disables the constrained size checks.

This function does not fail.