Un-Alignment Jpeg picture display issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Un-Alignment Jpeg picture display issue

Un-Alignment Jpeg picture display issue


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

Tags (1)
%3CLINGO-SUB%20id%3D%22lingo-sub-1100512%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EUn-Alignment%20Jpeg%20picture%20display%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1100512%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CBR%20%2F%3ECurrently%2C%20we%20meet%20an%20issue%20that%20some%20jpeg%20pictures%20can't%20be%20displayed%20on%26nbsp%3B%20imx53%20platform%20by%20command%20%22gst-launch%20filesrc%20location%3DJPEGFILE%20!%20jpegdec%20!%20freeze%20!%20mfw_isink%22%2C%20the%20system%20will%20meet%20application%20crash.%20So%20we%20did%20investigation%20on%20this%2C%20found%20imx6%20aslo%20has%20such%20issue.%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20found%20that%20the%20issue%20happen%20on%20specific%20jpeg%20pictures%2C%20the%20width%20%26amp%3B%20height%20is%20not%208%20pixels%20alignment.%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20track%20the%20code%20%2C%26nbsp%3B%20found%20that%20the%20jpeg%20decoder%20send%20the%20width%20and%20height%20to%20isink%20plugin%2C%20also%20it%20send%20a%20outsize%20calculate%20by%20the%20width%20and%20height%20with%20algorithm%20that%20will%20do%202%20pixels%2C4%20pixles%2C8pixles%20alignment(I420_SIZE%20(width%2C%20height)).%20The%20isink%20use%20a%20different%20algorithm%20to%20calculate%20the%20decoder%20buffer%2C%20this%20size%20is%20always%20smaller%20than%20the%20size%20pass%20down%20by%20the%20jpeg%20decoder%20%2C%20in%20later%20memory%20copy%2C%20the%20code%20copy%20a%20large%20memory%20to%20smaller%20memory%2C%20it's%20out%20of%20boundery%2C%20corrupt%20the%20memoryand%20cause%20the%20application%20fail.%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20we%20make%20a%20little%20change%2C%20to%20malloc%20the%20larger%20size%20to%20avoid%20the%20out%20of%20boundry.%3C%2FP%3E%3CP%3E%3CSTRONG%3EOriginal%20Attachment%20has%20been%20moved%20to%3A%20%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-339367%22%20target%3D%22_blank%22%3Efix-8pixels-unalignment-jpeg-display-crash.patch.zip%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎12-22-2013 10:37 PM
Updated by: