mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 00:38:06 +02:00
Check for valid path status value before calling _cairo_set_error
cairo_status_t is a signed type, so we need to check for invalid codes that are < 0 as well. Also removes the MSVC goop in path-data.c that was attempting to work around the assert earlier.
This commit is contained in:
parent
bcc13ede9b
commit
924bbd06f3
2 changed files with 2 additions and 12 deletions
|
|
@ -2923,7 +2923,8 @@ cairo_append_path (cairo_t *cr,
|
|||
}
|
||||
|
||||
if (path->status) {
|
||||
if (path->status <= CAIRO_STATUS_LAST_STATUS)
|
||||
if (path->status > CAIRO_STATUS_SUCCESS &&
|
||||
path->status <= CAIRO_STATUS_LAST_STATUS)
|
||||
_cairo_set_error (cr, path->status);
|
||||
else
|
||||
_cairo_set_error (cr, CAIRO_STATUS_INVALID_STATUS);
|
||||
|
|
|
|||
11
test/path-data.c
Executable file → Normal file
11
test/path-data.c
Executable file → Normal file
|
|
@ -143,10 +143,6 @@ draw (cairo_t *cr, int width, int height)
|
|||
return CAIRO_TEST_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
|
@ -155,13 +151,6 @@ main (void)
|
|||
cairo_path_t path;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* This test triggers an assert, and we don't want an assert dialog;
|
||||
* have to do this here since the assert happens before cairo_test() */
|
||||
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
|
||||
#endif
|
||||
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
|
||||
|
||||
/* Test a few error cases for cairo_append_path_data */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue