• R/O
  • SSH

wp2latex: Commit

WP2LaTeX sources.


Commit MetaInfo

Revision11a908d571b3e136fc6623eb10e6e94d7e035778 (tree)
Zeit2022-04-30 17:22:11
AutorFojtik
CommiterFojtik

Log Message

Fixed wrong WMF header CRC calcullation.

Ändern Zusammenfassung

Diff

diff -r 32dae9ccec86 -r 11a908d571b3 trunk/sources.cc/pass1wmf.cc
--- a/trunk/sources.cc/pass1wmf.cc Fri Apr 29 09:26:26 2022 +0200
+++ b/trunk/sources.cc/pass1wmf.cc Sat Apr 30 10:22:11 2022 +0200
@@ -1940,6 +1940,8 @@
19401940 else ActualPos+= 2*WmfRec.Size;
19411941
19421942 fseek(wpd,ActualPos,SEEK_SET);
1943+ if(WmfRec.Function==0)
1944+ break; // Break loop on WMF End
19431945 }
19441946 else
19451947 ActualPos = ftell(wpd);
@@ -2100,10 +2102,10 @@
21002102
21012103 DWORD Checksum = hdr.Key;
21022104 Checksum ^= hdr.Handle;
2103- Checksum ^= hdr.Left;
2104- Checksum ^= hdr.Top;
2105- Checksum ^= hdr.Right;
2106- Checksum ^= hdr.Bottom;
2105+ Checksum ^= (WORD)hdr.Left; // Convert to unsigned to prevent sign expansion.
2106+ Checksum ^= (WORD)hdr.Top;
2107+ Checksum ^= (WORD)hdr.Right;
2108+ Checksum ^= (WORD)hdr.Bottom;
21072109 Checksum ^= hdr.Inch;
21082110 Checksum ^= hdr.Reserved;
21092111
diff -r 32dae9ccec86 -r 11a908d571b3 trunk/sources.cc/wp2latex.h
--- a/trunk/sources.cc/wp2latex.h Fri Apr 29 09:26:26 2022 +0200
+++ b/trunk/sources.cc/wp2latex.h Sat Apr 30 10:22:11 2022 +0200
@@ -18,7 +18,7 @@
1818 #define LineLength 80 /* Split lines after more than LineLength charcters */
1919
2020 #define VersionWP2L "3.pre107"
21-#define VersionDate "26 Apr 2022" /* day (space) month (space) full year */
21+#define VersionDate "30 Apr 2022" /* day (space) month (space) full year */
2222
2323 #ifndef false
2424 #define false 0
Show on old repository browser