diff options
-rw-r--r-- | MagickCore/draw.c | 6 | ||||
-rw-r--r-- | MagickCore/xml-tree.c | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/MagickCore/draw.c b/MagickCore/draw.c index c724be834..9322d6b5c 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -337,7 +337,7 @@ MagickExport DrawInfo *CloneDrawInfo(const ImageInfo *image_info, x; for (x=0; fabs(draw_info->dash_pattern[x]) >= MagickEpsilon; x++) ; - clone_info->dash_pattern=(double *) AcquireQuantumMemory((size_t) (x+4), + clone_info->dash_pattern=(double *) AcquireQuantumMemory((size_t) (x+1), sizeof(*clone_info->dash_pattern)); if (clone_info->dash_pattern == (double *) NULL) ThrowFatalException(ResourceLimitFatalError, @@ -3562,7 +3562,7 @@ static MagickBooleanType RenderMVGContent(Image *image, GetNextToken(r,&r,extent,token); } graphic_context[n]->dash_pattern=(double *) - AcquireQuantumMemory((size_t) (2*x+4), + AcquireQuantumMemory((size_t) (2*x+2), sizeof(*graphic_context[n]->dash_pattern)); if (graphic_context[n]->dash_pattern == (double *) NULL) { @@ -3573,7 +3573,7 @@ static MagickBooleanType RenderMVGContent(Image *image, break; } (void) memset(graphic_context[n]->dash_pattern,0,(size_t) - (2*x+4)*sizeof(*graphic_context[n]->dash_pattern)); + (2*x+2)*sizeof(*graphic_context[n]->dash_pattern)); for (j=0; j < x; j++) { GetNextToken(q,&q,extent,token); diff --git a/MagickCore/xml-tree.c b/MagickCore/xml-tree.c index de99fc67a..61b219f87 100644 --- a/MagickCore/xml-tree.c +++ b/MagickCore/xml-tree.c @@ -2377,8 +2377,7 @@ MagickExport XMLTreeInfo *NewXMLTreeTag(const char *tag) root->entities=(char **) AcquireMagickMemory(sizeof(predefined_entities)); if (root->entities == (char **) NULL) return((XMLTreeInfo *) NULL); - (void) memcpy(root->entities,predefined_entities, - sizeof(predefined_entities)); + (void) memcpy(root->entities,predefined_entities,sizeof(predefined_entities)); root->root.attributes=sentinel; root->attributes=(char ***) root->root.attributes; root->processing_instructions=(char ***) root->root.attributes; |