Hello all.

I noticed the following problem with UFRaw: it's possible to set invalid (too 
small) 
crop dimensions and this results in division by zero in libjpeg while writing 
the result file.

I guess UFRaw should check if the result image dimensions are valid and throw 
an error if they are not.

How to reproduce:

# ufraw-batch <raw file --crop-top=10 --crop-bottom=10 --crop-left=10 
--crop-right=10

Program received signal SIGFPE, Arithmetic exception.
0xb7c6b19c in alloc_sarray (cinfo=0xbffde6b4, pool_id=1, samplesperrow=0, 
numrows=1) at ./jmemmgr.c:406
406     ./jmemmgr.c: No such file or directory.
        in ./jmemmgr.c
(gdb) bt
#0  0xb7c6b19c in alloc_sarray (cinfo=0xbffde6b4, pool_id=1, samplesperrow=0, 
numrows=1) at ./jmemmgr.c:406
#1  0xb7c5525f in jinit_c_prep_controller (cinfo=0xbffde6b4, 
need_full_buffer=0) at ./jcprepct.c:347
#2  0xb7c53748 in jinit_compress_master (cinfo=0xbffde6b4) at ./jcinit.c:39
#3  0xb7c51e21 in jpeg_start_compress (cinfo=0xbffde6b4, write_all_tables=1) at 
./jcapistd.c:50
#4  0x0806143a in ufraw_write_image (uf=0x8123ff8) at ufraw_writer.c:437
#5  0x0804dba2 in ufraw_batch_saver (uf=0x8123ff8) at ufraw-batch.c:159
#6  0x0804df18 in main (argc=7, argv=0xbffff104) at ufraw-batch.c:108
(gdb) f 4
#4  0x0806143a in ufraw_write_image (uf=0x8123ff8) at ufraw_writer.c:437
437             jpeg_start_compress(&cinfo, TRUE);
(gdb) p cinfo
$1 = {err = 0xbffde828, mem = 0x8123a18, progress = 0x0, client_data = 
0x8123ff8, is_decompressor = 0, global_state =
    100, dest = 0x815277c, image_width = 0, image_height = 0, .....

-- 
Wbr,
Antony Dovgal
---
http://pinba.org - realtime statistics for PHP

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
ufraw-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-devel

Reply via email to