From 2114c4241891849323fd65e56f1ab6f70375a291 Mon Sep 17 00:00:00 2001 From: "Guo, Yejun" Date: Sat, 21 Mar 2020 17:33:26 +0800 Subject: [PATCH] avfilter/vf_dnn_processing.c: fix typo for the linesize of dnn data Signed-off-by: Guo, Yejun --- libavfilter/vf_dnn_processing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c index fabe4f1d01..cf589acedf 100644 --- a/libavfilter/vf_dnn_processing.c +++ b/libavfilter/vf_dnn_processing.c @@ -329,7 +329,7 @@ static int copy_from_frame_to_dnn(DnnProcessingContext *ctx, const AVFrame *fram if (dnn_input->dt == DNN_FLOAT) { sws_scale(ctx->sws_gray8_to_grayf32, (const uint8_t **)frame->data, frame->linesize, 0, frame->height, (uint8_t * const*)(&dnn_input->data), - (const int [4]){frame->linesize[0] * sizeof(float), 0, 0, 0}); + (const int [4]){frame->width * 3 * sizeof(float), 0, 0, 0}); } else { av_assert0(dnn_input->dt == DNN_UINT8); av_image_copy_plane(dnn_input->data, bytewidth, @@ -369,7 +369,7 @@ static int copy_from_dnn_to_frame(DnnProcessingContext *ctx, AVFrame *frame) case AV_PIX_FMT_BGR24: if (dnn_output->dt == DNN_FLOAT) { sws_scale(ctx->sws_grayf32_to_gray8, (const uint8_t *[4]){(const uint8_t *)dnn_output->data, 0, 0, 0}, - (const int[4]){frame->linesize[0] * sizeof(float), 0, 0, 0}, + (const int[4]){frame->width * 3 * sizeof(float), 0, 0, 0}, 0, frame->height, (uint8_t * const*)frame->data, frame->linesize); } else {