acinclude/ltversion.m4
author Sam Lantinga <slouken@libsdl.org>
Wed, 30 Nov 2016 22:06:05 -0800
changeset 10668 1889c850fafc
parent 6442 2d3caa191dc4
permissions -rw-r--r--
Fixed bug 3340 - SDL_BlitScaled causes access violation in some cases.

Simon Hug

The SDL_BlitScaled function runs into an access violation for specific blit coordinates and surface sizes. The attached testcase blits a 800x600 surface to a 1280x720 surface at the coordinates -640,-345 scaled to 1280x720. The blit function that moves the data then runs over and reads after the pixel data from the src surface causing an access violation.

I can't say where exactly it goes wrong, but I think it could have something to do with the rounding in SDL_UpperBlitScaled. final_src.y is 288 and final_src.h is 313. Together that's 601, which I believe is one too much, but I just don't know the code enough to make sure that's the problem.

Sylvain

I think this patch fix the issue, but maybe it's worth re-writing "SDL_UpperBlitScaled" using SDL_FRect.
slouken@3342
     1
# ltversion.m4 -- version numbers			-*- Autoconf -*-
slouken@3342
     2
#
slouken@3342
     3
#   Copyright (C) 2004 Free Software Foundation, Inc.
slouken@3342
     4
#   Written by Scott James Remnant, 2004
slouken@3342
     5
#
slouken@3342
     6
# This file is free software; the Free Software Foundation gives
slouken@3342
     7
# unlimited permission to copy and/or distribute it, with or without
slouken@3342
     8
# modifications, as long as this notice is preserved.
slouken@3342
     9
slouken@6442
    10
# @configure_input@
slouken@3342
    11
slouken@6442
    12
# serial 3337 ltversion.m4
slouken@3342
    13
# This file is part of GNU Libtool
slouken@3342
    14
slouken@6442
    15
m4_define([LT_PACKAGE_VERSION], [2.4.2])
slouken@6442
    16
m4_define([LT_PACKAGE_REVISION], [1.3337])
slouken@3342
    17
slouken@3342
    18
AC_DEFUN([LTVERSION_VERSION],
slouken@6442
    19
[macro_version='2.4.2'
slouken@6442
    20
macro_revision='1.3337'
slouken@3342
    21
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
slouken@3342
    22
_LT_DECL(, macro_revision, 0)
slouken@3342
    23
])