summaryrefslogtreecommitdiff
path: root/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
diff options
context:
space:
mode:
authorShubhanshu Saxena <shubhanshu.e01@gmail.com>2022-03-02 23:35:50 +0530
committerGuo Yejun <yejun.guo@intel.com>2022-03-12 15:10:28 +0800
commitb602f11a0671273dcf08607c37197a41c437463e (patch)
treee956d6ca6872642bb83a3f1a2ea3b9cfdb6ee04a /libavfilter/dnn/dnn_backend_native_layer_mathunary.c
parente5ce6a60708fb9cd2ec46f6302c3bc943e330f16 (diff)
lavfi/dnn: Error Specificity in Native Backend Layers
This commit returns specific error codes from the execution functions in the Native Backend layers instead of DNN_ERROR. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
Diffstat (limited to 'libavfilter/dnn/dnn_backend_native_layer_mathunary.c')
-rw-r--r--libavfilter/dnn/dnn_backend_native_layer_mathunary.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
index b8694910d9..e3c5106e5e 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
@@ -68,12 +68,12 @@ int ff_dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_o
output->length = ff_calculate_operand_data_length(output);
if (output->length <= 0) {
av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n");
- return DNN_ERROR;
+ return AVERROR(EINVAL);
}
output->data = av_realloc(output->data, output->length);
if (!output->data) {
av_log(ctx, AV_LOG_ERROR, "Failed to reallocate memory for output\n");
- return DNN_ERROR;
+ return AVERROR(ENOMEM);
}
dims_count = ff_calculate_operand_dims_count(output);
@@ -151,6 +151,6 @@ int ff_dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_o
return 0;
default:
av_log(ctx, AV_LOG_ERROR, "Unmatch math unary operator\n");
- return DNN_ERROR;
+ return AVERROR(EINVAL);
}
}