Re: gdiplus crash with small source.
- From: "Ben Harper" <ben@xxxxxxxxx>
- Date: Fri, 10 Jun 2005 10:06:59 +0200
The exception is an write violation, but that doesn't matter. It doesn't
matter either that I duplicate points. It should not crash. It's not my
responsibility to ensure that legal input doesn't crash the dll. I'm not
looking for a workaround, because the problem is hard to isolate. I'm
looking for a bugfix.
"Christian Kaiser" <bchk@xxxxxx> wrote in message
news:OS1hxqPbFHA.2124@xxxxxxxxxxxxxxxxxxxxxxx
> Question: what sort of GPF?
>
> If GPI somewhere calculates the distance between the points, giving the
> same
> point twice could result in a division by zero if GDI uses the distance as
> divisor in some code.
>
> Christian
>
> "Arnaud VALLAT" <vallat_a@xxxxxxxxxxx> wrote in message
> news:ujfsxiPbFHA.4040@xxxxxxxxxxxxxxxxxxxxxxx
>> Arnaud VALLAT wrote:
>>> Ben Harper wrote:
>>>
>>>> I have this small project consisting of legal (to the best of my
>>>> knowledge) source which causes a GPF in gdiplus.dll. Please could
>>>> somebody from Microsoft repond on this? I will continue to repost this
>>>> message until such time.
>>>>
>>>> Thanks,
>>>> Ben
>>>>
>>> Hi,
>>>
>>> I'm not from Microsoft but I have tested your code and I think I have
>>> found the problem : negative values ... I have just done that :
>>>
>>> srand((unsigned int)time(NULL));
>>>
>>> int criticalWidth = 612;
>>> int criticalHeight = 317;
>>>
>>> Point ptsb[NP];
>>> for ( int i = 0; i < NP; i++ )
>>> {
>>> ptsb[i].X = rand() % criticalWidth; //ptsa[i].x;
>>> ptsb[i].Y = rand() % criticalHeight; // ptsa[i].y;
>>> }
>>>
>>>
>>> And there is no more problem.
>>>
>>> Rno
>>
>> In fact it's not that ... My solution works but if I change this on
>> your original code :
>>
>> POINT ptsa[NP] = {
>> {552, -2},
>> {535, 5},
>> {527, -12},
>> {523, -11},
>> {520, -17},
>> {519, -16},
>> {517, -20},
>> {516, -19},
>> {507, -37},
>> {511, -47},
>> {518, -44},
>> {519, -43},
>> {533, -52},
>> {543, -58},
>> {545, -60},
>> {548, -61},
>> {553, -64},
>> {564, -71},
>> {585, -15},
>> {610, -26},
>> {611, -27},
>> {612, -27},
>> {615, -25},
>> {619, -21},
>> {627, -10},
>> {628, -10},//{627, -10}, // it was there twice
>> {622, -7},
>> {620, -7},
>> {610, -6},
>> {610, -4},
>> {609, -3},
>> {608, -1},
>> {606, 0},
>> {606, 2},
>> {605, 3},
>> {605, 5},
>> {604, 7},
>> {605, 25},
>> {605, 26},
>> {605, 28},
>> {592, 42},
>> {591, 45},
>> {586, 52},
>> {585, 53},
>> {581, 57},
>> {576, 63},
>> {552, -2} };
>>
>> There is no more problem.
>>
>> I don't understand too why it crashes.
>>
>> Sorry.
>>
>> Rno
>> --
>> Arnaud VALLAT
>
>
.
- References:
- Re: gdiplus crash with small source.
- From: Arnaud VALLAT
- Re: gdiplus crash with small source.
- From: Arnaud VALLAT
- Re: gdiplus crash with small source.
- From: Christian Kaiser
- Re: gdiplus crash with small source.
- Prev by Date: Re: SetROP2(hDC, R2_NOT) and RGB(128, 128, 128)
- Next by Date: Re: SetROP2(hDC, R2_NOT) and RGB(128, 128, 128)
- Previous by thread: Re: gdiplus crash with small source.
- Next by thread: gdi+ (CPU usage 100%)
- Index(es):
Relevant Pages
|