Closed SmileChen007 closed 5 years ago
Thanks for your report,
Is there any way in your setup that you can get a stack trace of the C code that runs?
In C, the signature of lodepng_decode32_file is:
unsigned lodepng_decode32_file(unsigned char* out, unsigned w, unsigned h, const char filename);
Are width and height pointers in your code? If "width = 0" means it's a null pointer, that will cause a crash since it wants to write the width to the unsigned integer it points to. Same also for raw_rgba_pixels where it wants to output a pointer to a a buffer it allocates inside. How are pointers handled in this setup?
Thanks
ok,thanks,I try another way to solve my problem, I run executable file to handle my png.
Thanks, I use Python, so i use lodepng.c and lodepng.h to create .so file by gcc on ubuntu, then it create liblodepng.so . The order is 'gcc lodepng.c -I ./ -fPIC -shared -o liblodepng.so' but when i use this liblodepng.so, it report a bug,
The bug is : bash: line 1: 14557 Segmentation fault (core dumped) env "PYTHONUNBUFFERED"="1" "PYTHONPATH"="/tmp/pycharm_project_500:/root/.pycharm_helpers/pycharm_matplotlib_backend" "PYCHARM_HOSTED"="1" "JETBRAINS_REMOTE_RUN"="1" "PYCHARM_MATPLOTLIB_PORT"="52649" "PYTHONIOENCODING"="UTF-8" '/home/ubuntu/env/env_fun/bin/python3.5' '-u' '/tmp/pycharm_project_500/png/test.py'
i don't why, the zip file it contains liblodepng.so liblodepng.zip