diff mbox series

[FFmpeg-devel,1/4] avfilter/vf_dnn_processing.c: fix typo for the linesize of dnn data

Message ID 1584936480-9033-1-git-send-email-yejun.guo@intel.com
State Accepted
Headers show
Series [FFmpeg-devel,1/4] avfilter/vf_dnn_processing.c: fix typo for the linesize of dnn data
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Guo, Yejun March 23, 2020, 4:08 a.m. UTC
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
---
 libavfilter/vf_dnn_processing.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c
index fabe4f1..cf589ac 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 {