Hello,
we are adding the support of .HEIC images to our software. But we’ve faced strange random failures: sometimes CopyPixels returns HRESULT 0xc00d36bb (“An unexpected error has occurred in the operation requested”).
What we do: there is an executable which decodes an image and the last function of the code is CopyPixels. The executable returns its result. At some machines, running the executable in a loop goes quite smoothly, it does not fail for hours and days. But at some machines, the code fails after 10-20-30 attempts. Sometimes even the first execution fails.
At the same time, the same code does not fail if BMP or JPEG data is passed to it. It fails only with HEIC image data. And it does not matter if 49x49 or 64x64 HEIC image hardcoded data is passed to it or a real image from iPhone X (4032 x 3024) is loaded.
We also tried to call CopyPixels looped: it looked like if the first call of CopyPixels succeeded, all other CopyPixels calls did not fail in the same process. But as soon as it failed, several next calls to it failed as well but then, it stopped failing. If to try to load a HEIF file in Paint at the moment we got the failure, the loading in Paint fails too. If the first loading in Paint succeeds, it does always, even if our code fails sometimes.
All above concerns HEVC video extension of version 1.0.30442.0 and HEIF of v. 10.0.18362.1031
If to uninstall HEVC 1.0.30442.0 and to install HEVC 1.0.30443.0 from MS Store, the same code behavior gets much more stable.
I wonder if there is a bug in HEVC 1.0.30442.0 or we use WIC incorrectly? Our using it, looks to be correct as other format images (BMP, JPEG) are decoded without a problem (by the same code!) and we have never had any failures with them.
I can provide the VS2017 solution with the source code, as well as the batch we use for running the exe but I failed to attach it ("Body text cannot contain images or links until we are able to verify your account")
We would be much obliged if somebody advised how to avoid facing the failures. Thanks in advance.