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

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

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
28{28{
29 struct SwsContext *sws_ctx;29 struct SwsContext *sws_ctx;
30 int bytewidth = av_image_get_linesize(frame->format, frame->width, 0);30 int bytewidth = av_image_get_linesize(frame->format, frame->width, 0);
31 if (bytewidth < 0) {
32 return DNN_ERROR;
33 }
31 if (output->dt != DNN_FLOAT) {34 if (output->dt != DNN_FLOAT) {
32 avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT");35 avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT");
33 return DNN_ERROR;36 return DNN_ERROR;
@@ -98,6 +101,9 @@ static DNNReturnType proc_from_frame_to_dnn_frameprocessing(AVFrame *frame, DNND · 64 unmodified lines
98{101{
99 struct SwsContext *sws_ctx;102 struct SwsContext *sws_ctx;
100 int bytewidth = av_image_get_linesize(frame->format, frame->width, 0);103 int bytewidth = av_image_get_linesize(frame->format, frame->width, 0);
104 if (bytewidth < 0) {
105 return DNN_ERROR;
106 }
101 if (input->dt != DNN_FLOAT) {107 if (input->dt != DNN_FLOAT) {
102 avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT");108 avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT");
103 return DNN_ERROR;109 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