mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-17 21:00:51 +00:00
dnn/dnn_backend_native: Don't use asserts for checks
asserts should not be used instead of ordinary input checks. Yet the native DNN backend did it: get_input_native() asserted that the first dimension was one, despite this value coming directly from the input file without having been sanitized. Reviewed-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
0e078c6cfa
commit
1e47ef600d
@ -232,6 +232,8 @@ DNNModel *ff_dnn_load_model_native(const char *model_filename, DNNFunctionType f
|
|||||||
oprd->dims[dim] = (int32_t)avio_rl32(model_file_context);
|
oprd->dims[dim] = (int32_t)avio_rl32(model_file_context);
|
||||||
dnn_size += 4;
|
dnn_size += 4;
|
||||||
}
|
}
|
||||||
|
if (oprd->type == DOT_INPUT && oprd->dims[0] != 1)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
oprd->isNHWC = 1;
|
oprd->isNHWC = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user