Skip to content

Program received signal SIGFPE, Arithmetic exception. at quant_encode in quant.c #65

@ambrosecm

Description

@ambrosecm

Desctiption

When I used the quant_encode function to handle a specific input, Program received signal SIGFPE, Arithmetic exception. at quant_encode in quant.c

ffjpeg/src/quant.c

Lines 29 to 37 in caade60

void quant_encode(int du[64], int qtab[64])
{
int i; for (i=0; i<64; i++) du[i] /= qtab[i];
}
void quant_decode(int du[64], int qtab[64])
{
int i; for (i=0; i<64; i++) du[i] *= qtab[i];
}

Test Environment

Ubuntu 22.04.1, 64bit
ffjpeg(master caade60)
program source file

How to trigger

Download the poc file , program and run the following cmd:

 $ ./quant_encode ./poc

Detail

GDB report

(gdb) r
Starting program: /data/ambrose/output/ffjpeg_temperature_test/ffjpeg_deepseek/crashes/jfif.c/jfif_encode_du/quant_encode/quant_encode output/default/crashes/id:000000,sig:08,src:000001,time:852,execs:672,op:quick,pos:321
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGFPE, Arithmetic exception.
0x0000555555559f68 in quant_encode ()
(gdb) bt
#0  0x0000555555559f68 in quant_encode ()
#1  0x0000555555558d61 in main (argc=2, argv=0x7fffffffdc78)
    at /home/ambrose/vsproject/HIMFuzz/harness/output/ffjpeg_deepseek/harness/code/jfif.c/jfif_encode_du/quant_encode.c:48

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions