Un-Alignment Jpeg picture display issue

Document created by Jack Mao Employee on Dec 22, 2013Last modified by ebiz_ws_prod on Dec 13, 2017
Version 3Show Document
  • View in full screen mode

Currently, we meet an issue that some jpeg pictures can't be displayed on  imx53 platform by command "gst-launch filesrc location=JPEGFILE ! jpegdec ! freeze ! mfw_isink", the system will meet application crash. So we did investigation on this, found imx6 aslo has such issue.


We found that the issue happen on specific jpeg pictures, the width & height is not 8 pixels alignment.


After track the code ,  found that the jpeg decoder send the width and height to isink plugin, also it send a outsize calculate by the width and height with algorithm that will do 2 pixels,4 pixles,8pixles alignment(I420_SIZE (width, height)). The isink use a different algorithm to calculate the decoder buffer, this size is always smaller than the size pass down by the jpeg decoder , in later memory copy, the code copy a large memory to smaller memory, it's out of boundery, corrupt the memoryand cause the application fail.


So we make a little change, to malloc the larger size to avoid the out of boundry.

Original Attachment has been moved to: fix-8pixels-unalignment-jpeg-display-crash.patch.zip