RTF to PDF conversion fails for strange images

I am converting RTF file to PDF with Libreoffice in headless mode, via PHP code.

Here is my sample code:

shell_exec('libreoffice4.2 --headless --invisible --norestore --convert-to pdf --outdir /pdf /html/test.rtf');

I observed that Libreoffice is not able to convert the RTF to PDF file, if the RTF file contains any strange images, like this one|attachment

All the text is converted to PDF just fine, but don’t know what is preventing Libreoffice to skip the conversion in the case of existence of strange images in RTF file. The same RTF file containing strange images could be converted to PDF, using the COM extension of PHP under Windows.

Could you attach an example file which does not work?

Well, i noticed that the problem is not with the size of the RTF file, but due to a strange image inside it.

Sounds like a bug – please report it at https://www.libreoffice.org/get-help/bug/