Skip to content

Commit

Permalink
Fix stride problems causing video playback to get corrupted
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
EIREXE committed Oct 17, 2023
1 parent 1f54ef0 commit 67017dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion video_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,10 @@ void VideoDecoder::_read_decoded_frames(AVFrame *p_received_frame) {
uint8_t *unwrapped_frame_ptrw = unwrapped_frame.ptrw();
{
ZoneNamedN(image_unwrap_memcopy, "memcpy", true);
memcpy(unwrapped_frame_ptrw, frame->get_frame()->data[0], frame_size);
for (int y = 0; y < height; y++) {
memcpy(unwrapped_frame_ptrw, frame->get_frame()->data[0] + y * frame->get_frame()->linesize[0], width * 4);
unwrapped_frame_ptrw += width * 4;
}
}
unwrapped_frame.resize(width * height * 4);
if (!image.is_valid()) {
Expand Down

0 comments on commit 67017dc

Please sign in to comment.