Fix for 687417, Infinite loop in t1_hinter__set_mapping() on Alpha

Alex Cherepanov <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Organization Coscript Software
Message-ID <[email protected]>
Keep calculation in signed types to avoid conversion of the negative
int to the big positive long, which caused infinite loop on Alpha in
t1_hinter__adjust_matrix_precision() inline function.
Fix bug 687417.

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
gxhintn.c.diff (text/plain, 982 B)
Index: gs/src/gxhintn.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gxhintn.c,v
retrieving revision 1.47
diff -b -u -r1.47 gxhintn.c
--- a/gs/src/gxhintn.c	1 Apr 2004 20:39:44 -0000	1.47
+++ b/gs/src/gxhintn.c	16 Apr 2004 21:39:26 -0000
@@ -560,8 +560,8 @@
 
 private inline void t1_hinter__set_origin(t1_hinter * this, fixed dx, fixed dy)
 {   
-    uint align_x = urshift(fixed_1, (this->align_to_pixels ? (int)this->log2_pixels_x : this->log2_subpixels_x));
-    uint align_y = urshift(fixed_1, (this->align_to_pixels ? (int)this->log2_pixels_y : this->log2_subpixels_y));
+    fixed align_x = rshift(fixed_1, (this->align_to_pixels ? (int)this->log2_pixels_x : this->log2_subpixels_x));
+    fixed align_y = rshift(fixed_1, (this->align_to_pixels ? (int)this->log2_pixels_y : this->log2_subpixels_y));
 
     this->orig_dx = (dx + align_x / 2) & ~(align_x - 1);
     this->orig_dy = (dy + align_y / 2) & ~(align_y - 1);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.