Also there is this new warning:

podofo/doc/PdfImage.cpp: In function 'void
PoDoFo::LoadFromPngContent(png_structp, png_infop, PoDoFo::PdfImage*)':
podofo/doc/PdfImage.cpp:943:30: warning: variable 'color' might be
clobbered by 'longjmp' or 'vfork' [-Wclobbered]
  943 |                     png_byte color;
      |                              ^~~~~

One must be very cautious about designing code around setjmp and longjmp.


On Tue, Jun 16, 2020 at 2:57 AM Michal Sudolsky <sudols...@gmail.com> wrote:

> This fixes ticket #90. And for those who use these image loading functions
> note that there are still these leaks described in ticket #89 (not
> introduced by this patch, but it seems that this patch introduces some
> leak, smask will not be deallocated in case some method of PdfImage throws).
>
> On Mon, Jun 15, 2020 at 9:17 AM zyx <z...@gmx.us> wrote:
>
>> On Fri, 2020-06-12 at 11:28 +0200, Christian Sakowski wrote:
>> > this patch is currently not part of the trunk but very important! Can
>> > someone check this in, please?
>>
>>         Hi,
>> thanks for the reminder. I missed it in the mailing list.
>>
>> That patch, even the file itself, is a nice mix of different coding
>> styles. Not a big deal, just being noticed.
>>
>> It introduced a new compiler warning here:
>>
>> .../src/podofo/doc/PdfImage.cpp: In function ‘void
>> PoDoFo::LoadFromPngContent(png_structp, png_infop, PoDoFo::PdfImage*)’:
>> .../src/podofo/doc/PdfImage.cpp:934:91: warning: suggest parentheses
>> around ‘&&’ within ‘||’ [-Wparentheses]
>>   934 |         color_type == PNG_COLOR_TYPE_PALETTE &&
>> png_get_valid(pPng, pInfo, PNG_INFO_tRNS) && png_get_tRNS(pPng, pInfo,
>> &paletteTrans, &numTransColors, NULL))
>>       |
>>  
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> which I fixed before committing. I also made the LoadFromPngContent() a
>> static function.
>>
>> I cannot really test this, thus I trust you with this.
>>
>> The patch had been committed as r2011:
>> http://sourceforge.net/p/podofo/code/2011
>>
>>         Thanks and bye,
>>         zyx
>>
>>
>>
>> _______________________________________________
>> Podofo-users mailing list
>> Podofo-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/podofo-users
>>
>
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to