matplotlib/matplotlib — pull request #3009 by solvents (2014-04-25 23:18:56+00:00)
Title: BUG: Showing a BboxImage can cause a segmentation fault

This is in response to issue #2963. It turns out that BboxImage's ```make_image``` method could potentially calculate a negative width or height if it was constructed from an "inverted" Bbox, which is then passed to ```Image::resize```.

From there, the width and height are interpreted as unsigned by agg, which leads to a segfault.
Small example:
```
from matplotlib.image import BboxImage, imread
from matplotlib.transforms import Bbox
import matplotlib.pyplot as plt

ax = plt.axes()
bbox_image = BboxImage(Bbox([[100, 100], [0, 0]]))
path = '/usr/share/pixmaps/firefox.png'
image = imread(path)
bbox_image.set_data(image)
ax.add_artist(bbox_image)
plt.show()
```

This revealed another problem, in ```BboxImage.show```, since (once fixed), inverting the order of the two corners passed into the Bbox constructor changes where the image is rendered.