Replace line fixing symptoms by assertions, to reveal the cause

This commit is contained in:
Laurent Fasnacht 2014-05-09 06:56:31 +02:00
parent 4dbf7c7a52
commit 3f975e92cd

View file

@ -79,8 +79,9 @@ void picture_blit_pixels(const pixel *orig, pixel *dst,
unsigned orig_stride, unsigned dst_stride)
{
unsigned y, x;
//Fix problem with reading unitialized memory
if (width > orig_stride) width = orig_stride;
//There is absolutely no reason to have a width greater than the source or the destination stride.
assert(width <= orig_stride);
assert(width <= dst_stride);
for (y = 0; y < height; ++y) {
for (x = 0; x < width; ++x) {