Some error recovery
This commit is contained in:
parent
c91115dad4
commit
e510d92b17
1
hi/mkv.c
1
hi/mkv.c
@ -563,6 +563,7 @@ static int muxmkv_start(CHiPubNode *pubn) {
|
||||
this->fd = fopen(CHi_Crawl(&pubn->sinks[CUTIHI_MUXWEBM_IN_FILENAME])->data.text, "wb");
|
||||
|
||||
if(!this->fd) {
|
||||
CHi_AddError(pubn, "invalid file", CUTIHI_MUXWEBM_IN_FILENAME);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
21
hi/node.c
21
hi/node.c
@ -534,9 +534,7 @@ static int image_perform(CHiPubNode *node) {
|
||||
}
|
||||
|
||||
if(node->sinks[CUTIHI_IMAGE_IN_FILE].type != CUTIHI_VAL_TEXT) {
|
||||
node->errors.active[0] = true;
|
||||
strncpy(node->errors.code[0], "invalid type", CUTIHI_ERR_SIZE);
|
||||
node->errors.sink[0] = CUTIHI_IMAGE_IN_FILE;
|
||||
CHi_AddError(node, "invalid type", 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -549,9 +547,7 @@ static int image_perform(CHiPubNode *node) {
|
||||
if(!internal->cacheImg) {
|
||||
struct sail_image *simg;
|
||||
if(sail_load_from_file(fn, &simg) != SAIL_OK) {
|
||||
node->errors.active[0] = true;
|
||||
strncpy(node->errors.code[0], "invalid file", CUTIHI_ERR_SIZE);
|
||||
node->errors.sink[0] = CUTIHI_IMAGE_IN_FILE;
|
||||
CHi_AddError(node, "invalid file", 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -574,6 +570,9 @@ static int image_perform(CHiPubNode *node) {
|
||||
}
|
||||
|
||||
sail_destroy_image(cimg);
|
||||
|
||||
free(internal->cachePath);
|
||||
internal->cachePath = strdup(fn);
|
||||
}
|
||||
|
||||
if(CHi_Node_Active(node)) {
|
||||
@ -717,9 +716,7 @@ static int modulate_perform(CHiPubNode *node) {
|
||||
}
|
||||
|
||||
if(imgsrc->type != CUTIHI_VAL_SAMPLE) {
|
||||
node->errors.active[0] = true;
|
||||
strncpy(node->errors.code[0], "invalid type", CUTIHI_ERR_SIZE);
|
||||
node->errors.sink[0] = 0;
|
||||
CHi_AddError(node, "invalid type", 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -728,11 +725,15 @@ static int modulate_perform(CHiPubNode *node) {
|
||||
|
||||
if(!CHi_Node_Active(node)) {
|
||||
node->sources->data.sample = NULL;
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
CHiImage *src = imgsrc->data.sample;
|
||||
|
||||
if(!src) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
assert(src->stride % 16 == 0);
|
||||
|
||||
CHiImage *dst = CHi_Image_New(2, 4, src->stride, src->width, src->height, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user