Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in openjpegV1.4 on compiling image_to_j2k: crash on reading bmp file #108

Closed
gcode-importer opened this issue Jan 15, 2012 · 8 comments
Assignees
Milestone

Comments

@gcode-importer
Copy link

Originally reported on Google Code with ID 108

Hi there, I‘m Nick and didn‘t really compile a source code for 7years, so any dummy
verification can be performed.
I then compile image_to_j2k and its dependant files using Code::blocks and gcc under
Windows.
Compilation runs fine but if I run the exe file with a bmp image, it crash (I only
tried with bmp file).
So I run it with the debugger, the function bmptoimage is called correctly, the file
is red and *image point on the image data but when exiting the function, image is 
not properly returned, so image point on NULL and code crash.
I also tried to have image as bmptoimage function parameter but it doesn‘t solve the
pb.
Thanks for your help.
Nic


Reported by nicolas.guerineau64 on 2012-01-15 23:35:27

@gcode-importer
Copy link
Author

Hi there, 
I'm now on my laptop so I can give you more information:
1) I used the last version: openjpeg_v1_4_sources_r697
2) I change the #include lines in mainly all files in order it respects the project
directory architecture of the zip file
3) In codec/convert.c in line 566 and 567 I replaced 
W = Info_h.biWidth;
H = Info_h.biHeight;
by 
W = w;
H = h;
as Info_h.biWidth and Info_h.biHeight don't contain the right information on that section
(but they do on line 487 and 493 for instruction w = Info_h.biWidth; and h = Info_h.biHeight;
).
4) Compilation gives warning on all converting image functions, for example for bmptoimage,
warnings are : 
C:\code\image_to_j2k\codec\convert.c||In function 'bmptoimage':|
C:\code\image_to_j2k\codec\convert.c|221|warning: implicit declaration of function
'opj_image_create' [-Wimplicit-function-declaration]|
C:\code\image_to_j2k\codec\convert.c|221|warning: assignment makes pointer from integer
without a cast [enabled by default]|
C:\code\image_to_j2k\codec\convert.c|415|warning: implicit declaration of function
'opj_image_destroy' [-Wimplicit-function-declaration]|


||Warning: resolving _opj_image_create by linking to _opj_image_create@12|
||Warning: resolving _opj_image_destroy by linking to _opj_image_destroy@4|
||Warning: resolving _opj_cio_open by linking to _opj_cio_open@12|
||Warning: resolving _opj_cio_close by linking to _opj_cio_close@4|
||Warning: resolving _cio_tell by linking to _cio_tell@4|

5) Assuming its not important warning, if I run the program in debbuging mode, I received
the following error message when trying to return from function bmptoimage :
Program received signal SIGSEGV, Segmentation fault.
In ?? () ()
As if the program lost its return stack position before leaving meanwhile the stack
shows the main() address when bmptoimage is processing, then it shows :
| Nr | Address  | Function
| 0  | 00000000 | 0x00000019 in ??()
| 1  | 00000000 | 0x0022a528 in ??()
| 2  | 00000000 | 0x00000000 in ??()

Hope you have enough information and can help me,
Thanks,
Nic

Reported by nicolas.guerineau64 on 2012-01-16 10:21:51

@gcode-importer
Copy link
Author

Nicolas,

>1) I used the last version: openjpeg_v1_4_sources_r697

The last revision is 'r1324'.

You can download it here:

svn checkout http://openjpeg.googlecode.com/svn/branches/openjpeg-1.5/ opj-branch15

'r697' is buggy, should have been removed, but has not been removed.
And is a never closed source of issues.

winfried

Reported by szukw000 on 2012-01-16 21:47:09

@gcode-importer
Copy link
Author

Dear Winfried,

Thanks for your reply.
I then download part of the trunk repository (as I use my phone to connect to the Internet
and have some trouble to retrieve all files) but still have a problem. As it is different,
I opened a new issue.

Thanks,
Nic

Reported by nicolas.guerineau64 on 2012-01-17 12:35:21

@gcode-importer
Copy link
Author

Nic, openjpeg 1.5 is out. It provide both windows installer and zip file of compiled
binaries.

Can you still reproduce this issue ? Can you share this BMP file ?

Thanks

Reported by malaterre on 2012-02-10 10:34:29

@gcode-importer
Copy link
Author

Dear Matthiew,

I already downloaded the V1.5 thanks to SVN.
If you download the source code, and just try to compile it with Code:blocks (using
GCC), you will have the same problem.
I then modified the #include path to solve problem and (re)declare the functions:
pj_image_create by linking to _opj_image_create@12|
* opj_image_destroy
* opj_cio_open
* opj_cio_close
* cio_tell
in the right header file (instead beeing declared in opengjpeg.h and as the DEPRICATED
label before).
It runs good now.
It you want, I can send you my c and h files to avoid modifying all of them. I didn't
upload them using SVN to avoid any trouble (and I'm a new SVN user). Just let me know.
Thanks for your help.

Reported by nicolas.guerineau64 on 2012-02-12 03:12:44

@gcode-importer
Copy link
Author

As indicated above, please share your bmp file. Thanks

Reported by malaterre on 2012-05-29 16:02:10

@gcode-importer
Copy link
Author

Reported by malaterre on 2014-02-25 15:57:22

  • Labels added: Milestone-Release2.1

@gcode-importer
Copy link
Author

no input from OP, closing issue.

Reported by malaterre on 2014-02-26 14:13:16

  • Status changed: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants