What does HRESULT 0x88982F51 (WINCODEC_ERR_IMAGESIZEOUTOFRANGE) mean?

 
Previous Next
WINCODEC_ERR_COMPONENTNOTFOUND WINCODEC_ERR_TOOMUCHMETADATA

WINCODEC_ERR_IMAGESIZEOUTOFRANGE

WINCODEC_ERR_IMAGESIZEOUTOFRANGE means that an image width, height, total pixel count, or related allocation size is outside the range accepted by the WIC codec. It can occur with malformed headers as well as valid but unusually large images.

What to check

  • Validate untrusted dimensions before allocating memory or calculating stride and total byte count.
  • Check multiplication for overflow: width × bytes-per-pixel × height can exceed a 32-bit or size-type limit before allocation fails.
  • Apply application-level pixel-count limits for uploads and previews so a decompression bomb does not reach the decode pipeline unchecked.

Keep the original dimensions in the error report; they identify whether the failure is malformed input or an intentional size limit.

Microsoft: WIC decoding overview


Looking for a different code? Search another status or error code.