Skip to content

Commit 50c5ac6

Browse files
committed
Fix unsigned overflow.
I'm not sure what exactly causes it, but there are some cases where assImage->dst_x/y will be set when there is nothing to render, which results in bad behavior.
1 parent 73c3e74 commit 50c5ac6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ASSInspector.c

+4
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ int assi_calculateBounds( ASSI_State *state, ASSI_Rect *rects, const int32_t *ti
201201
}
202202
assImage = assImage->next;
203203
}
204+
205+
boundsRect.x2 = (boundsRect.x2 < boundsRect.x1)? boundsRect.x1: boundsRect.x2;
206+
boundsRect.y2 = (boundsRect.y2 < boundsRect.y1)? boundsRect.y1: boundsRect.y2;
207+
204208
rects[i].x = boundsRect.x1;
205209
rects[i].y = boundsRect.y1;
206210
rects[i].w = boundsRect.x2 - boundsRect.x1;

0 commit comments

Comments
 (0)