source:
trunk/server/common/patches/dvipng-CVE-2010-0829.patch
@
1559
Last change on this file since 1559 was 1559, checked in by mitchb, 14 years ago | |
---|---|
File size: 3.6 KB |
-
dvipng.h
old new 387 374 void WriteImage(char*, int); 388 375 void LoadPK(int32_t, register struct char_entry *); 389 376 int32_t SetChar(int32_t); 390 dviunits SetGlyph( int32_t c, int32_t hh,int32_t vv);377 dviunits SetGlyph(struct char_entry *ptr, int32_t hh,int32_t vv); 391 378 void Gamma(double gamma); 392 int32_t SetVF( int32_t);379 int32_t SetVF(struct char_entry *ptr); 393 380 int32_t SetRule(int32_t, int32_t, int32_t, int32_t); 394 381 void SetSpecial(char *, int32_t, int32_t); 395 382 void BeginVFMacro(struct font_entry*); -
draw.c
old new 79 79 80 80 if (currentfont==NULL) 81 81 Fatal("faulty DVI, trying to set character from null font"); 82 83 if (c>=0 && c<=LASTFNTCHAR) 84 ptr = currentfont->chr[c]; 82 if (c<0 || c>LASTFNTCHAR) { 83 Warning("glyph index out of range (%d), skipping",c); 84 return(0); 85 } 86 ptr=currentfont->chr[c]; 87 if (ptr==NULL) { 88 Warning("unable to draw glyph %d, skipping",c); 89 return(0); 90 } 85 91 #ifdef DEBUG 86 92 switch (currentfont->type) { 87 93 case FONT_TYPE_VF: DEBUG_PRINT(DEBUG_DVI,("\n VF CHAR:\t")); break; … … 90 96 case FONT_TYPE_FT: DEBUG_PRINT(DEBUG_DVI,("\n FT CHAR:\t")); break; 91 97 default: DEBUG_PRINT(DEBUG_DVI,("\n NO CHAR:\t")) 92 98 } 93 if ( isprint(c))99 if (debug & DEBUG_DVI && c>=0 && c<=UCHAR_MAX && isprint(c)) 94 100 DEBUG_PRINT(DEBUG_DVI,("'%c' ",c)); 95 101 DEBUG_PRINT(DEBUG_DVI,("%d at (%d,%d) tfmw %d", c, 96 102 dvi_stack->hh,dvi_stack->vv,ptr?ptr->tfmw:0)); 97 103 #endif 98 104 if (currentfont->type==FONT_TYPE_VF) { 99 return(SetVF( c));105 return(SetVF(ptr)); 100 106 } else { 101 if (ptr !=NULL && ptr->data == NULL)107 if (ptr->data == NULL) 102 108 switch(currentfont->type) { 103 109 case FONT_TYPE_PK: LoadPK(c, ptr); break; 104 110 #ifdef HAVE_LIBT1 … … 111 117 Fatal("undefined fonttype %d",currentfont->type); 112 118 } 113 119 if (page_imagep != NULL) 114 return(SetGlyph( c, dvi_stack->hh, dvi_stack->vv));115 else if (ptr!=NULL){120 return(SetGlyph(ptr, dvi_stack->hh, dvi_stack->vv)); 121 else { 116 122 /* Expand bounding box if necessary */ 117 123 min(x_min,dvi_stack->hh - ptr->xOffset/shrinkfactor); 118 124 min(y_min,dvi_stack->vv - ptr->yOffset/shrinkfactor); -
vf.c
old new 27 27 #define VF_ID 202 28 28 #define LONG_CHAR 242 29 29 30 int32_t SetVF( int32_t c)30 int32_t SetVF(struct char_entry* ptr) 31 31 { 32 32 struct font_entry* currentvf; 33 33 unsigned char *command,*end; 34 struct char_entry* ptr=currentfont->chr[c];35 34 36 35 currentvf=currentfont; 37 36 BeginVFMacro(currentvf); -
set.c
old new 203 202 } 204 203 } 205 204 206 dviunits SetGlyph( int32_t c, int32_t hh,int32_t vv)205 dviunits SetGlyph(struct char_entry *ptr, int32_t hh,int32_t vv) 207 206 /* gdImageChar can only do monochrome glyphs */ 208 207 { 209 register struct char_entry *ptr;210 208 int dst_alpha,dst_weight,tot_weight,alpha; 211 209 int x,y,pos=0; 212 210 int bgColor,pixelgrey,pixelcolor; 213 211 214 if (c<0 || c>LASTFNTCHAR) {215 Warning("glyph index too large (%d), skipping",c);216 return(0);217 }218 ptr=currentfont->chr[c];219 if (ptr==NULL) {220 Warning("unable to draw glyph %d, skipping",c);221 return(0);222 }223 212 hh -= ptr->xOffset/shrinkfactor; 224 213 vv -= ptr->yOffset/shrinkfactor; 225 214 /* Initialize persistent color cache. Perhaps this should be in
Note: See TracBrowser
for help on using the repository browser.