]> git.sesse.net Git - ffmpeg/commitdiff
avutil/hwcontext_cuda: fix edge case with non-even frame heights
authorTimo Rothenpieler <timo@rothenpieler.org>
Wed, 4 Nov 2020 00:36:48 +0000 (01:36 +0100)
committerTimo Rothenpieler <timo@rothenpieler.org>
Wed, 4 Nov 2020 00:36:48 +0000 (01:36 +0100)
libavutil/hwcontext_cuda.c

index 7278bd2988007ea8edacd59f683a8ec73f265cdd..58ffc81378730f722b7f55b0aa514e074e66cd01 100644 (file)
@@ -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;