[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-games-devel
Subject: Re: [Kde-games-devel] Review Request 126919: Fix crash when placing bonuses in the arena
From: Mathias Kraus <k.hias () gmx ! de>
Date: 2016-01-29 19:29:00
Message-ID: 20160129192900.17778.46751 () mimi ! kde ! org
[Download RAW message or body]
--===============7868315093446387988==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126919/#review91788
-----------------------------------------------------------
Ship it!
Ship It!
- Mathias Kraus
On Jan. 28, 2016, 1:30 p.m., Julian Helfferich wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126919/
> -----------------------------------------------------------
>
> (Updated Jan. 28, 2016, 1:30 p.m.)
>
>
> Review request for KDE Games.
>
>
> Repository: granatier
>
>
> Description
> -------
>
> The crash takes place in game.cpp - Game::createBonus(). The total amount of blocks \
> is nFullSize. To place the bonuses, the game iterates over 4 quarters, the first \
> three containing nFullSize/4 blocks and the last containing the remaining blocks. \
> Thus, nQuarterSize can be larger for the last quarter than for the previous three. \
> Now, when a bonus is assigned to a block, the index of the block is calculated as
> nIndex = nQuarter * nQuarterSize + i
>
> where i iterates from zero to nQuarterSize. The idea is that nQuarter * \
> nQuarterSize is the number of blocks of the previous quarters. However, since \
> nQuarterSize can be larger for the last quarter, this can lead to an index out of \
> bounds when a bonus is to be placed in one of the last blocks. The fixed version is \
> nIndex = nQuarter * (nFullSize/4) + i
>
> where nFullSize/4 is the size of the first three quarters.
>
>
> Diffs
> -----
>
> src/game.cpp 371fac9
>
> Diff: https://git.reviewboard.kde.org/r/126919/diff/
>
>
> Testing
> -------
>
> Started the game a lot of times. Crash did not happen.
>
>
> Thanks,
>
> Julian Helfferich
>
>
--===============7868315093446387988==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;"> \
<tr> <td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/126919/">https://git.reviewboard.kde.org/r/126919/</a>
</td>
</tr>
</table>
<br />
<p>
Ship it!
</p>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ship It!</pre> <br />
<p>- Mathias Kraus</p>
<br />
<p>On January 28th, 2016, 1:30 p.m. UTC, Julian Helfferich wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;"> <tr>
<td>
<div>Review request for KDE Games.</div>
<div>By Julian Helfferich.</div>
<p style="color: grey;"><i>Updated Jan. 28, 2016, 1:30 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
granatier
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">The crash takes place in game.cpp - \
Game::createBonus(). The total amount of blocks is nFullSize. To place the bonuses, \
the game iterates over 4 quarters, the first three containing nFullSize/4 blocks and \
the last containing the remaining blocks. Thus, nQuarterSize can be larger for the \
last quarter than for the previous three. Now, when a bonus is assigned to a block, \
the index of the block is calculated as</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">nIndex = nQuarter * \
nQuarterSize + i</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">where i iterates from zero to \
nQuarterSize. The idea is that nQuarter * nQuarterSize is the number of blocks of the \
previous quarters. However, since nQuarterSize can be larger for the last quarter, \
this can lead to an index out of bounds when a bonus is to be placed in one of the \
last blocks. The fixed version is</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">nIndex = nQuarter * \
(nFullSize/4) + i</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">where nFullSize/4 is the size of the \
first three quarters.</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Started the game a lot of times. Crash did not \
happen.</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/game.cpp <span style="color: grey">(371fac9)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/126919/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============7868315093446387988==--
[Attachment #3 (text/plain)]
_______________________________________________
kde-games-devel mailing list
kde-games-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-games-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic