Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59e295c

Browse files
committed
Fix segfault in FT2Font::clear()
svn path=/trunk/matplotlib/; revision=3785
1 parent cb62706 commit 59e295c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/ft2font.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ void FT2Image::resize(unsigned long width, unsigned long height) {
7575
if (width != _width || height != _height) {
7676
if (numBytes > _width*_height) {
7777
delete [] _buffer;
78+
_buffer = NULL;
7879
_buffer = new unsigned char [numBytes];
7980
}
8081

@@ -781,6 +782,7 @@ FT2Font::clear(const Py::Tuple & args) {
781782
args.verify_length(0);
782783

783784
delete image;
785+
image = NULL;
784786

785787
angle = 0.0;
786788

0 commit comments

Comments
 (0)