History

lavfi/dnn/dnn_io_proc.c: fix Improper use of negative value (NEGATIVE_RETURNS)

fix coverity CID 1473511 and 1473566

Guo, Yejun committed 5 years ago

Commit 3fb1d2e1 parent bd6ea9e1 file · +6 −0Browse files

Unified · Split

libavfilter/dnn/dnn_io_proc.c+6−0
@@ -28,6 +28,9 @@ DNNReturnType ff_proc_from_dnn_to_frame(AVFrame *frame, DNNData *output, void *l · 27 unmodified lines
2828 {
2929 struct SwsContext *sws_ctx;
3030 int bytewidth = av_image_get_linesize(frame->format, frame->width, 0);
31+ if (bytewidth < 0) {
32+ return DNN_ERROR;
33+ }
3134 if (output->dt != DNN_FLOAT) {
3235 avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT");
3336 return DNN_ERROR;
@@ -98,6 +101,9 @@ static DNNReturnType proc_from_frame_to_dnn_frameprocessing(AVFrame *frame, DNND · 64 unmodified lines
98101 {
99102 struct SwsContext *sws_ctx;
100103 int bytewidth = av_image_get_linesize(frame->format, frame->width, 0);
104+ if (bytewidth < 0) {
105+ return DNN_ERROR;
106+ }
101107 if (input->dt != DNN_FLOAT) {
102108 avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT");
103109 return DNN_ERROR;

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