Beyka / Android-TiffBitmapFactory

MIT License
131 stars 46 forks source link

TiffSaver.saveBitmap causes Fatal signal 11 (SIGSEGV) #46

Open vbresan opened 3 years ago

vbresan commented 3 years ago

I am calling:

TiffSaver.saveBitmap(file, bitmap);

Bitmap is a gif image loaded with Android's BitmapFactory.decodeStream. It seems that everything is fine with the gif image as it is properly decoded and encoded to other formats supported natively by Android.

However, the call results with the following error: A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 3220 (Thread-2250)

The error can not be caught with a catch clause in java code, the app just crashes immediately. I am attaching the gif file:

dilbert2073207040504

vbresan commented 3 years ago

It looks like it might be a general problem with bitmaps that come from gif files. I have attached another one.

Once again, calling bitmap.compress to any format supported by Android natively, doesn't produce any error.

0007 TEST

vbresan commented 3 years ago

I have also set saver to throw exceptions and limited memory usage, it didn't help. The same crash happened. Here is the code snippet of what I have tried:


        TiffSaver.SaveOptions options = new TiffSaver.SaveOptions();
        options.inThrowException  = true;
        options.inAvailableMemory = 10000000;

        try {
            TiffSaver.saveBitmap(file, bitmap, options);
        } catch (Exception e) {
            e.printStackTrace();    // it never gets caught
        }