Browse Source

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

tags/n4.4
Timo Rothenpieler 5 years ago
parent
commit
98d3f23598
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavutil/hwcontext_cuda.c

+ 1
- 1
libavutil/hwcontext_cuda.c View File

@@ -190,7 +190,7 @@ static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
if (ctx->sw_format == AV_PIX_FMT_YUV420P) { if (ctx->sw_format == AV_PIX_FMT_YUV420P) {
frame->linesize[1] = frame->linesize[2] = frame->linesize[0] / 2; frame->linesize[1] = frame->linesize[2] = frame->linesize[0] / 2;
frame->data[2] = frame->data[1]; 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; frame->format = AV_PIX_FMT_CUDA;


Loading…
Cancel
Save