What max resolution jpeg support?
ChinaTizenRT opened this issue · 4 comments
when i decoding 3840_2160 jpeg it will Segmentation fault
#./jpegdec 3840_2160.jpg
JPEG decoder demo
Run without parameters to test in-memory decoding
Or pass a filename
Segmentation fault (core dumped)
There is no size limit, but there are many ways you can make it crash. Are you checking all return codes? Are you using a callback function for the file I/O? Please provide a glimpse of the code you're using and I can probably tell you what's going wrong. It would help if you provided more info about where the crash is occurring. Since you're obviously running on a Linux system, use GDB to show you the function name / line of code where the segmentation fault happens.
@bitbank2 thanks for your replay.
I am using the original code in the JPEGDEC/linux, and running in ubuntu system
cd JPEGDEC/linux
sudo make
/jpegdec 3840_2160.jpg
and add -g debug build info for debug crash, below is the key output
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7e2ced8 in fread () at iofread.c:37
37 iofread.c: No such file or directory.
(gdb)
Found the problem - I changed the demo app to generate 4-bpp dithered output without allocating a buffer for it. Remove this line --> "jpg.ucPixelType = FOUR_BIT_DITHERED;" and it will work correctly.
thanks, I tested it works as your said.