troosh / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by nicolas....@gmail.com on 15 Jan 2012 at 11:35

GoogleCodeExporter commented 9 years ago
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

Original comment by nicolas....@gmail.com on 16 Jan 2012 at 10:21

GoogleCodeExporter commented 9 years ago
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

Original comment by szukw...@arcor.de on 16 Jan 2012 at 9:47

GoogleCodeExporter commented 9 years ago
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

Original comment by nicolas....@gmail.com on 17 Jan 2012 at 12:35

GoogleCodeExporter commented 9 years ago
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

Original comment by mathieu.malaterre on 10 Feb 2012 at 10:34

GoogleCodeExporter commented 9 years ago
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.

Original comment by nicolas....@gmail.com on 12 Feb 2012 at 3:12

GoogleCodeExporter commented 9 years ago
As indicated above, please share your bmp file. Thanks

Original comment by mathieu.malaterre on 29 May 2012 at 4:02

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 25 Feb 2014 at 3:57

GoogleCodeExporter commented 9 years ago
no input from OP, closing issue.

Original comment by mathieu.malaterre on 26 Feb 2014 at 2:13