Skip to content

Commit

Permalink
MythNVDECContext: Fix buffer overrun
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed May 15, 2019
1 parent ba86839 commit 6bb4375
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/mythnvdeccontext.cpp
Expand Up @@ -133,7 +133,7 @@ enum AVPixelFormat MythNVDECContext::GetFormat(AVCodecContext* Context, const AV
LOG(VB_PLAYBACK, LOG_INFO, LOC + "Re-using CUDA context");
return *PixFmt;
}
PixFmt++;
PixFmt++;
}
}
return AV_PIX_FMT_NONE;
Expand All @@ -155,7 +155,7 @@ int MythNVDECContext::GetBuffer(struct AVCodecContext *Context, AVFrame *Frame,
AvFormatDecoder *avfd = static_cast<AvFormatDecoder*>(Context->opaque);
VideoFrame *videoframe = avfd->GetPlayer()->GetNextVideoFrame();

for (int i = 0; i < 4; i++)
for (int i = 0; i < 3; i++)
{
videoframe->pitches[i] = Frame->linesize[i];
videoframe->offsets[i] = Frame->data[i] ? (static_cast<int>(Frame->data[i] - Frame->data[0])) : 0;
Expand Down

0 comments on commit 6bb4375

Please sign in to comment.