[FFmpeg-cvslog] avutil/hwcontext_cuda: fix edge case with non-even frame heights

Timo Rothenpieler git at videolan.org
Wed Nov 4 03:16:54 EET 2020


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Wed Nov  4 01:36:48 2020 +0100| [98d3f2359853f1908092b6244f429ced838f493b] | committer: Timo Rothenpieler

avutil/hwcontext_cuda: fix edge case with non-even frame heights

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98d3f2359853f1908092b6244f429ced838f493b
---

 libavutil/hwcontext_cuda.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c
index 7278bd2988..58ffc81378 100644
--- a/libavutil/hwcontext_cuda.c
+++ b/libavutil/hwcontext_cuda.c
@@ -190,7 +190,7 @@ static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
     if (ctx->sw_format == AV_PIX_FMT_YUV420P) {
         frame->linesize[1] = frame->linesize[2] = frame->linesize[0] / 2;
         frame->data[2]     = frame->data[1];
-        frame->data[1]     = frame->data[2] + frame->linesize[2] * ctx->height / 2;
+        frame->data[1]     = frame->data[2] + frame->linesize[2] * (ctx->height / 2);
     }
 
     frame->format = AV_PIX_FMT_CUDA;



More information about the ffmpeg-cvslog mailing list