strukturag / libde265

Open h.265 video codec implementation.
Other
1.72k stars 458 forks source link

A memory allocation error is not handled #330

Closed nhiroki09 closed 1 year ago

nhiroki09 commented 2 years ago

Decoding large image consumes large size of memory, so insufficient memory tends to occur on 32bit process. In an out of memory situation, de265_image::alloc_image() may fail to allocate memory and returns DE265_ERROR_OUT_OF_MEMORY. But decoded_picture_buffer::new_image() ignores DE265_ERROR_OUT_OF_MEMORY from de265_image::alloc_image(), so a NULL pointer access occurs in de265_image::set_SliceAddrRS().

I think that decoded_picture::new_image() should return -1 when de265_image::alloc_image() returned DE265_ERROR_OUT_OF_MEMORY.

farindk commented 1 year ago

See the above change. Can you test this or attach a test image?