From 6703ee5d5a67391f351eec5d6efaabcaa044cdc9 Mon Sep 17 00:00:00 2001 From: "pnunn%netscape.com" Date: Mon, 17 Aug 1998 22:20:27 +0000 Subject: [PATCH] fix for #313251, migrating #312030 to mozilla. pnunn. ok'd by nisheeth. git-svn-id: svn://10.0.0.236/trunk@8106 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/lib/layout/layimage.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mozilla/lib/layout/layimage.c b/mozilla/lib/layout/layimage.c index cc7f2ab4a86..1139e7d163e 100644 --- a/mozilla/lib/layout/layimage.c +++ b/mozilla/lib/layout/layimage.c @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-R * * The contents of this file are subject to the Netscape Public License * Version 1.0 (the "NPL"); you may not use this file except in @@ -1149,6 +1149,8 @@ lo_BlockedImageLayout(MWContext *context, lo_DocState *state, PA_Tag *tag, image->percent_width = 0; val = FEUNITS_X(val, context); } + if (val < 0) + val = 0; image->width = val; PA_UNLOCK(buff); PA_FREE(buff); @@ -1212,6 +1214,8 @@ lo_BlockedImageLayout(MWContext *context, lo_DocState *state, PA_Tag *tag, image->percent_height = 0; val = FEUNITS_Y(val, context); } + if (val < 0) + val = 0; image->height = val; PA_UNLOCK(buff); PA_FREE(buff); @@ -1886,7 +1890,9 @@ lo_FormatImage(MWContext *context, lo_DocState *state, PA_Tag *tag) { image->percent_width = 0; val = FEUNITS_X(val, context); - } + } + if (val < 0) + val = 0; image->width = val; PA_UNLOCK(buff); PA_FREE(buff); @@ -1949,6 +1955,8 @@ lo_FormatImage(MWContext *context, lo_DocState *state, PA_Tag *tag) image->percent_height = 0; val = FEUNITS_Y(val, context); } + if (val < 0) + val = 0; image->height = val; PA_UNLOCK(buff); PA_FREE(buff);