MATLAB: Do I receive segmentation violation when I use EXIFREAD with a JPEG image on a 32-bit Linux machine in MATLAB 7.8 (R2009a)

MATLAB

When I use EXIFREAD to read EXIF information about my JPEG files, I receive the following segmentation violation for some of the JPEG image files:
Configuration:
MATLAB Version: 7.3.0.298 (R2006b)
Operating System: Linux 2.6.27-1cse.1 #1 SMP Thu Oct 16 14:34:59 PDT 2008 i686
GNU C Library: 2.8 stable
Window System: Colin Harrison (60900031), display localhost:12.0
Current Visual: 0x22 (class 4, depth 16)
Processor ID: x86 Family 15 Model 2 Stepping 7, GenuineIntel
Virtual Machine: Java 1.6.0_14 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode, sharing
Default Charset: UTF-8
Register State:
eax = 070502ca ebx = b0021138
ecx = b0021138 edx = 070502ca
esi = b4b4b580 edi = b4b4b402
ebp = bfbd1e18 esp = bfbd1e18
eip = b001eee6 flg = 00010202
Stack Trace:
[0] exif_info.mexglx:Get16u(0x070502ca, 0xb00221bc, 0xb4b4b528, 1) + 26 bytes
[1] exif_info.mexglx:ProcessThumbnailDir(0x070502ca, 0xb4b4b378 "MM", 520, 1) + 72 bytes
[2] exif_info.mexglx:ProcessExifDir(0xb4b4b380, 0xb4b4b378 "MM", 520, 0) + 2537 bytes
[3] exif_info.mexglx:process_EXIF(0xb4b4b370, 528, 1, 0x098dd130) + 385 bytes
[4] exif_info.mexglx:ReadJpegSections(0x098dd130, 1, 0, 0xb0021138) + 465 bytes
[5] exif_info.mexglx:ReadJpegFile(0x16421160 "images/arnospix_491710062.jpg", 1, 59, 0xb0021138) + 73 bytes
[6] exif_info.mexglx:ProcessFile(0x16421160 "images/arnospix_491710062.jpg", 1, 59, 0) + 90 bytes
[7] exif_info.mexglx:mexFunction(1, 0xbfbd2860, 2, 0xbfbd28c0) + 289 bytes
[8] libmex.so:mexRunMexFile(1, 0xbfbd2860, 2, 0xbfbd28c0) + 109 bytes
[9] libmex.so:Mfh_mex::runMexFileWithSignalProtection(int, mxArray_tag**, int, mxArray_tag**)(0x0b7d3a00, 1, 0xbfbd2860, 2) + 184 bytes
...

Best Answer

This enhancement has been incorporated in Release 2010a (R2010a). For previous product releases, read below for any possible workarounds:
If the image file has a minor corruption due to a bad next IFD pointer, you might receive this segmentation violation on a 32-bit Linux machine.
To work around it, download the attached patch. It would involve disabling thumbnail information. However, this may not be a problem because there is no way to read the actual thumbnail image.
Find the attachment, and follow the steps below to use the patch:
1. type the following at the prompt, and make a note of it:
tmp = fullfile(matlabroot, 'toolbox', 'matlab', 'imagesci', 'private')
2. exit MATLAB
3. CD into the directory ($MATLABROOT/toolbox/matlab/imagesci/private)
4. backup 'exif_info.mexglx' to 'exif_info.mexglx.old'
5. copy the new mex-file into the same directory
6. restart MATLAB
7. type the following at the MATLAB prompt:
rehash toolboxcache