Open EnchantedJohn opened 6 years ago
Program received signal SIGSEGV, Segmentation fault.
[----------------------------------registers-----------------------------------]
RAX: 0x1
RBX: 0x7f7f
RCX: 0xd17540 --> 0x0
RDX: 0x0
RSI: 0x0
RDI: 0xd16980 --> 0x0
RBP: 0xce8690 --> 0x4b8d40 (<StaticColorRanges::~StaticColorRanges()>: lea rsp,[rsp-0x98])
RSP: 0x7fffffffdb70 --> 0xd16968 --> 0x0
RIP: 0x54d222 (<TransformPaletteC
jb 0x54d1dd <TransformPaletteC
Could you please attach the input file and tell me the FLIF version?
The PoC file we found: palette_C.hpp:130.txt
@fouzhe FLIF' version is FLIF (Free Lossless Image Format) 0.3 [28 April 2017]
Also reproduced in aad2083c2508902f971b7a2aa2564eac2dbc6e3f and minimized with afl-tmin.
python3 -c "print ('P6\n5\n5050\n5050')" > flif-issue-506.txt
./flif --overwrite flif-issue-506.txt out.png
==19477==ERROR: AddressSanitizer: SEGV on unknown address 0x62a00002bffc (pc 0x5628a8616494 bp 0x7fffc813bca0 sp 0x7fffc813bac0 T0)
#0 0x5628a8616493 in TransformPaletteC<FileIO>::process(ColorRanges const*, std::vector<Image, std::allocator<Image> > const&) transform/palette_C.hpp:130
#1 0x5628a8759020 in bool flif_encode<FileIO>(FileIO&, std::vector<Image, std::allocator<Image> >&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, flif_options&) ./src/flif-enc.cpp:914
#2 0x5628a8519f74 in encode_flif(int, char**, std::vector<Image, std::allocator<Image> >&, flif_options&) ./src/flif.cpp:344
#3 0x5628a84896de in main ./src/flif.cpp:763
#4 0x7f78430d62e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
#5 0x5628a850bfa9 in _start (./src/flif+0xa1fa9)
I found another Bug of FLIF.
the error is : Warning: expected ".png", ".pnm" or ".pam" file name extension for input file, trying anyway... ASAN:SIGSEGV ==91270==ERROR: AddressSanitizer: SEGV on unknown address 0x61f00002ec7c (pc 0x0000005c35fd sp 0x7ffff4203c00 bp 0x7ffff4203d60 T0)
0 0x5c35fc in TransformPaletteC::process(ColorRanges const*, std::vector<Image, std::allocator > const&) transform/palette_C.hpp:130
AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV transform/palette_C.hpp:130 TransformPaletteC::process(ColorRanges const*, std::vector<Image, std::allocator > const&)
==91270==ABORTING