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 | 29 | struct SwsContext *sws_ctx; |
| 30 | 30 | int bytewidth = av_image_get_linesize(frame->format, frame->width, 0); |
| 31 | + if (bytewidth < 0) { | |
| 32 | + return DNN_ERROR; | |
| 33 | + } | |
| 31 | 34 | if (output->dt != DNN_FLOAT) { |
| 32 | 35 | avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT"); |
| 33 | 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 | 102 | struct SwsContext *sws_ctx; |
| 100 | 103 | int bytewidth = av_image_get_linesize(frame->format, frame->width, 0); |
| 104 | + if (bytewidth < 0) { | |
| 105 | + return DNN_ERROR; | |
| 106 | + } | |
| 101 | 107 | if (input->dt != DNN_FLOAT) { |
| 102 | 108 | avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT"); |
| 103 | 109 | return DNN_ERROR; |