fix coverity CID 1473511 and 1473566
Unified · Split
| @@ -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; |