ExternalCameraHAL: Pad AllocatedFrame by DCTSIZE
jpeglib expects height and width of Y component to be an integral multiple of 2*DCTSIZE, and heights and widths of Cb and Cr components to be an integral multiple of DCTSIZE. If the image size does not meet this requirement, libjpeg expects its input to be padded to meet the constraints. The current implementation of AllocatedFrame::allocate did not consider this padding when allocating buffers. This could lead to crashes when attempting to call libjpeg functions on images with dimensions that are _not_ an exact multiple of 2*DCTSIZE (=16), for example: 424x240. This CL ensures that the allocated buffer is padded such that libjpeg never attempts to access unallocated buffer. Bug: 333961771 Test: Verified that the HAL no longer crashes for certain resolutions. Change-Id: I05b5f3390385ad005481141312a2e3e281433f7a
Loading
Please register or sign in to comment