Skip to content

Commit

Permalink
Fix #3304.
Browse files Browse the repository at this point in the history
Fix crash in tostring_rgba_minimized when the region has zero-size.

Thanks to @neothemachine for tracking this down.
  • Loading branch information
mdboom committed Jul 29, 2014
1 parent 49bb323 commit d797bc1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/_backend_agg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2420,6 +2420,12 @@ RendererAgg::tostring_rgba_minimized(const Py::Tuple& args)
*dst = src[y * width + x];
}
}
} else {
data = PyBytes_FromStringAndSize(NULL, 0);
if (data == NULL)
{
throw Py::MemoryError("RendererAgg::tostring_minimized could not allocate memory");
}
}

Py::Tuple bounds(4);
Expand Down

0 comments on commit d797bc1

Please sign in to comment.