Skip to content

Commit

Permalink
Merge pull request #1 from gejiyu/gejiyu-patch-1
Browse files Browse the repository at this point in the history
Update videobuffer.cpp
  • Loading branch information
gejiyu authored Aug 4, 2022
2 parents 59f952c + 40e420f commit 0f34d8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/device/decoder/videobuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ void VideoBuffer::peekRenderedFrame(std::function<void(int width, int height, ui
auto frame = m_renderingframe;
int width = frame->width;
int height = frame->height;
int linesize = frame->linesize[0];

// create buffer
uint8_t* rgbBuffer = new uint8_t[width * height * 4];
uint8_t* rgbBuffer = new uint8_t[linesize * height * 4];
AVFrame *rgbFrame = av_frame_alloc();
if (!rgbFrame) {
delete [] rgbBuffer;
Expand Down

0 comments on commit 0f34d8a

Please sign in to comment.