Skip to content

Commit

Permalink
repair memory issues for the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Aug 28, 2022
1 parent c5a9368 commit a0ce171
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coders/tiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
/*
Convert stripped TIFF image.
*/
extent=MagickMax(image->columns*(samples_per_pixel+extra_samples)*
extent=4*MagickMax(image->columns*(samples_per_pixel+extra_samples)*
(image->depth+7)/8,TIFFStripSize(tiff));
strip_pixels=(unsigned char *) AcquireQuantumMemory(extent,
sizeof(*strip_pixels));
Expand Down
6 changes: 5 additions & 1 deletion magick/annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,8 +1508,8 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
ft_status=FT_Open_Face(library,&args,face_index,&face);
if (ft_status != 0)
{
stream=RelinquishMagickMemory(stream);
(void) FT_Done_FreeType(library);
stream=RelinquishMagickMemory(stream);
ThrowFreetypeErrorException("UnableToReadFont",ft_status,args.pathname);
args.pathname=DestroyString(args.pathname);
return(MagickFalse);
Expand Down Expand Up @@ -1565,6 +1565,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
{
(void) FT_Done_Face(face);
(void) FT_Done_FreeType(library);
stream=RelinquishMagickMemory(stream);
ThrowFreetypeErrorException("UnrecognizedFontEncoding",ft_status,
encoding);
return(MagickFalse);
Expand Down Expand Up @@ -1597,6 +1598,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
{
(void) FT_Done_Face(face);
(void) FT_Done_FreeType(library);
stream=RelinquishMagickMemory(stream);
ThrowFreetypeErrorException("UnableToReadFont",ft_status,
draw_info->font);
return(MagickFalse);
Expand Down Expand Up @@ -1636,6 +1638,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
{
(void) FT_Done_Face(face);
(void) FT_Done_FreeType(library);
stream=(FT_StreamRec *) RelinquishMagickMemory(stream);
return(MagickTrue);
}
/*
Expand Down Expand Up @@ -1954,6 +1957,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
annotate_info=DestroyDrawInfo(annotate_info);
(void) FT_Done_Face(face);
(void) FT_Done_FreeType(library);
stream=(FT_StreamRec *) RelinquishMagickMemory(stream);
return(status);
}
#else
Expand Down

0 comments on commit a0ce171

Please sign in to comment.