Re: [GDI+: 2/10] first pen test
On Mo, 2007-06-11 at 11:52 -0700, Evan Stade wrote:
+ + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + + todo_wine + expect(GdiplusNotInitialized, status); + + GdipDeletePen(pen); +}
Is pen set to NULL, when GdipCreatePen1 failed? This ist not checked in your test and not done in your implementation, but you pass uninitialized garbage (pen) to GdipDeletePen. You might want to use: - GpPen *pen; + GpPen *pen = NULL; and - GdipDeletePen(pen); + if (status == Ok) then GdipDeletePen(pen); Thanks -- By by ... Detlef
On 6/12/07, Detlef Riekenberg <wine.dev(a)web.de> wrote:
On Mo, 2007-06-11 at 11:52 -0700, Evan Stade wrote:
+ + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + + todo_wine + expect(GdiplusNotInitialized, status); + + GdipDeletePen(pen); +}
Is pen set to NULL, when GdipCreatePen1 failed? This ist not checked in your test and not done in your implementation, but you pass uninitialized garbage (pen) to GdipDeletePen.
You might want to use: - GpPen *pen; + GpPen *pen = NULL; and - GdipDeletePen(pen); + if (status == Ok) then GdipDeletePen(pen);
Thanks
--
By by ... Detlef
In the native GDI+ passing uninitialized garbage to GdipDeletePen is not harmful.
"Evan Stade" <estade(a)gmail.com> writes:
In the native GDI+ passing uninitialized garbage to GdipDeletePen is not harmful.
That doesn't make the code correct. If you really want to pass garbage you have to do that explicitly with something like 0xdeadbeef; passing an uninitialized value to an API doesn't prove anything one way or another. -- Alexandre Julliard julliard(a)winehq.org
participants (3)
-
Alexandre Julliard -
Detlef Riekenberg -
Evan Stade