[Spice-devel,spice-common,1/2] common: prepare for not aborting on spice_critical

Submitted by Uri Lublin on Dec. 13, 2012, 5:54 p.m.

Details

Message ID 4a523274579619e99691eefafd71404ac88c9104.1355421013.git.uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin Dec. 13, 2012, 5:54 p.m.

Patch hide | download patch | download mbox

diff --git a/common/gdi_canvas.c b/common/gdi_canvas.c
index deb7649..05edf68 100644
--- a/common/gdi_canvas.c
+++ b/common/gdi_canvas.c
@@ -354,6 +354,7 @@  static void set_path(GdiCanvas *canvas, SpicePath *s)
                 if (!LineTo(canvas->dc, (int)fix_to_double(point->x),
                             (int)fix_to_double(point->y))) {
                     spice_critical("LineTo failed");
+                    return;
                 }
             }
         }
@@ -363,11 +364,13 @@  static void set_path(GdiCanvas *canvas, SpicePath *s)
             if (seg->flags & SPICE_PATH_CLOSE) {
                 if (!CloseFigure(canvas->dc)) {
                     spice_critical("CloseFigure failed");
+                    return;
                 }
             }
 
             if (!EndPath(canvas->dc)) {
                 spice_critical("EndPath failed");
+                return;
             }
         }