Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9dcc9eff authored by Avichal Rakesh's avatar Avichal Rakesh
Browse files

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
parent 1e3f8851
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment