Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cellRec: fix width of encoder frames #14476

Merged
merged 1 commit into from Aug 12, 2023
Merged

Conversation

Megamouse
Copy link
Contributor

@Megamouse Megamouse commented Aug 12, 2023

Turns out the pitch was accidentally used as width, leading to an out of bounds read/write. I kept the pitch in the struct for completeness' sake. It may be needed later, if only for error checks.

This fixes echochrome, which seems to be using recordings for some gameplay reason.
I didn't really bother trying to figure out how the gameplay works though.

Fixes #14466

Proof of the recording saved to dev_hdd1 and then exported to dev_hdd0
image
image
image

@@ -587,7 +587,7 @@ void rec_info::start_image_provider()
{
std::vector<u8> frame(frame_size);
std::memcpy(frame.data(), video_input_buffer.get_ptr(), frame.size());
encoder->add_frame(frame, input_format.pitch, input_format.height, input_format.av_pixel_format, timestamp_ms);
encoder->add_frame(frame, input_format.pitch, input_format.width, input_format.height, input_format.av_pixel_format, timestamp_ms);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only important line in this PR :)

Turns out the pitch was accidentally used as width, leading to an out of bounds read/write.
I kept the pitch in the struct for completeness' sake. It may be needed later, if only for error checks.
@Megamouse Megamouse merged commit 39bbf17 into RPCS3:master Aug 12, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Regression] echochrome no longer playable
1 participant