diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2021-12-24 02:12:55 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2021-12-24 02:12:55 +0100 |
| commit | 2c3bacd1ed7f68e407766d96fa3da72b08674d21 (patch) | |
| tree | 19808af52a1bdbc790c523fa5f878ffedcaab8c7 /src_c/common.c | |
| parent | 1a19c238e3741931db9e61b6a0b79259b5ed0753 (diff) | |
WIP c implementation
Diffstat (limited to 'src_c/common.c')
| -rw-r--r-- | src_c/common.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src_c/common.c b/src_c/common.c index 5aca7a8..271c2f9 100644 --- a/src_c/common.c +++ b/src_c/common.c @@ -277,6 +277,10 @@ static int read_panel(char *json, opcut_panel_t *panel, jsmntok_t *tokens, } } + if (panel->width <= 0 || panel->height <= 0) + return OPCUT_ERROR; + panel->area = panel->width * panel->height; + return OPCUT_SUCCESS; } @@ -315,6 +319,10 @@ static int read_item(char *json, opcut_item_t *item, jsmntok_t *tokens, } } + if (item->width <= 0 || item->height <= 0) + return OPCUT_ERROR; + item->area = item->width * item->height; + return OPCUT_SUCCESS; } |
