On Sat, Mar 12, 2022 at 6:49 PM zyx <z...@gmx.us> wrote:

> On Sat, 2022-03-12 at 17:45 +0100, zyx wrote:
> > I committed the patch as r2051:
> > http://sourceforge.net/p/podofo/code/2051
>
> ...and reverted in r2052:
> http://sourceforge.net/p/podofo/code/2052
>
> because the change causes stack overflow, by calling itself.
> Unfortunately, no unit test triggers this part of the code.
> I added a simple unit test in r2053:
> http://sourceforge.net/p/podofo/code/2053


How did you apply that patch? It should change line with:

-    return ((big << 8) & 0xFF00) | ((big >> 8) & 0x00FF);

Into two lines:

+    unsigned short little = Big2Little(*reinterpret_cast<unsigned
short*>(&big));
+    return *reinterpret_cast<short*>(&little);

There are two places where this change can happen but patch clearly states
it should happen in function with signature "inline short Big2Little(short
big)". Not in function "inline unsigned short Big2Little(unsigned short
big)" as in 2051.



>
>
> It's not a perfect test, but it at least triggers the Bit2Little()
> on little endian arches.
>
>         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