diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2018-09-24 22:02:54 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2018-09-24 22:02:54 +0800 |
commit | 4b0033220361a6b61454da84f8bdf7f801ceda52 (patch) | |
tree | acf6197b304197bae71bf4c498707dc8a83a2278 /libavfilter/vf_sr.c | |
parent | 8d29930767a0ef1aa2504468a6887c44a58e86c1 (diff) |
avfilter/sr: process and output message when load_model is NULL
fix ticket: 7455
Reviewed-by: Pedro Arthur <bygrandao@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavfilter/vf_sr.c')
-rw-r--r-- | libavfilter/vf_sr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c index 077ccc799c..6423d2ea11 100644 --- a/libavfilter/vf_sr.c +++ b/libavfilter/vf_sr.c @@ -75,7 +75,12 @@ static av_cold int init(AVFilterContext *context) return AVERROR(EIO); } else{ - sr_context->model = (sr_context->dnn_module->load_model)(sr_context->model_filename); + if (!sr_context->dnn_module->load_model) { + av_log(context, AV_LOG_ERROR, "load_model for network was not specified\n"); + return AVERROR(EIO); + } else { + sr_context->model = (sr_context->dnn_module->load_model)(sr_context->model_filename); + } } if (!sr_context->model){ av_log(context, AV_LOG_ERROR, "could not load DNN model\n"); |