History

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.

Andreas Rheinhardt committed 5 years ago

Commit 1e47ef61 parent 0e078c61 file · +2 −0Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/dnn/dnn_backend_native.c+2−0
@@ -232,6 +232,8 @@ DNNModel *ff_dnn_load_model_native(const char *model_filename, DNNFunctionType f · 231 unmodified lines
232232 oprd->dims[dim] = (int32_t)avio_rl32(model_file_context);
233233 dnn_size += 4;
234234 }
235+ if (oprd->type == DOT_INPUT && oprd->dims[0] != 1)
236+ goto fail;
235237
236238 oprd->isNHWC = 1;
237239 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t