Crash in "juce_loadJPEGImageFromStream" if jpeg is


#1

Hiiii,

When JPEG file is corrupted, ImageFileFormat::loadFrom(File) will crash :frowning: .

I m using juce 1.39

waiting for reply,
sree


#2

it’d probably help if you could link to a sample file which causes the crash for you


#3

Hi,

I just took one proper .jpg Image and opened it in text editor and deleted few characters at the end and saved it.

N then tried to load it .

If the file is corrupted it should not crash right???

{ I myself corrupting the file n checking, because our customers had this crash issue which we are not able to regenerate }

[color=red]
Crash Report :

Thread 0 Crashed:
0 <<00000000>> 0x00000000 0 + 0
1 com.digitaljuice.juicer 0x004fe39c juce::juce_loadJPEGImageFromStream(juce::InputStream&) + 460 (stream_decoder.c:2991)
2 com.digitaljuice.juicer 0x0042daa8 juce::ImageFileFormat::loadFrom(juce::File const&) + 56[/color]

I don’t know whether the way i m trying to check this crash is right or wrong :cry:

Need help,
Sree


#4

Well, juce use libjpeg for decoding. So, please check if it’s crashing similarly in libjpeg.

Another possibility could be that the libjpeg setlongjump isn’t defined correctly (check libjpeg error handling, search in the forum, I’ve already read something like this a while ago).