Search code examples
segmentation-faultflashpdf-conversionpdf2swf

SWFTools Segmentation Fault


I know that there are similar questions (here and here) but non of the answers worked for me.

When running pdf2swf sample.pdf -v -o sample.swf i get Segmentation fault:

...
VERBOSE colorMap pixcomps:3 bits:8 mode:2
NOTICE  File contains jpeg pictures
VERBOSE Drawing 1496x1808 transparent jpeg-image (id 151) at size 1496x1808 (548x663), >256 colors
Segmentation fault

The "-O 1" flag didn't work, dmesg wasn't helpful:

pdf2swf[29304]: segfault at 0000000000000000 rip 00002ac82a6c75b0 rsp 00007fff623484b0 error 4
pdf2swf[32714]: segfault at 0000000000000000 rip 00002b7f2e0145b0 rsp 00007fff68ea90c0 error 4

I have a similar servers with swftools working fine and processing the same file successfully. I've tried installing both version 0.9.1 as i have on my other server as well as installing the newest version available with no help.

I've installed with the following commands:

LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
make
make install

Anyone knows what might help?


Solution

  • I think I had a problem with one of the installation files that caused this problem. I've re-downloaded the next files:

    jpegsrc.v8d.tar
    freetype-2.3.12.tar.gz
    swftools-0.9.2.tar.gz
    

    and installed them in the following manner:

    # Install JPEGlib 8d
    tar -zvxf jpegsrc.v8d.tar
    cd /var/src/conversion/jpeg-8d
    ./configure
    make
    make install
    ranlib /usr/local/lib/libjpeg.a
    ldconfig /usr/local/lib
    
    # install freetype
    tar -zvxf freetype-2.3.12.tar.gz
    cd /var/src/conversion/freetype-2.3.12
    rm -f config.cache
    ranlib /usr/local/lib/libjpeg.a
    ldconfig /usr/local/lib
    export LDFLAGS="-L/usr/local/lib"
    export CPPFLAGS="-I/usr/local/include"
    ./configure
    make
    make install
    
    # Install SWFTOOL
    tar -zvxf swftools-0.9.2.tar.gz
    cd /var/src/conversion/swftools-0.9.2
    export LDFLAGS="-L/usr/local/lib"
    export CPPFLAGS="-I/usr/local/include" 
    ./configure
    make
    make install
    

    Now everything works, hope this will be helpful to others as well