[fix] fix crash due to invalid XVideoFrame size

This commit is contained in:
dijunkun
2025-03-11 22:57:00 +08:00
parent 092e894622
commit 2bf60a9c81
2 changed files with 3 additions and 1 deletions

View File

@@ -36,7 +36,8 @@ int ResolutionAdapter::ResolutionDowngrade(const XVideoFrame* video_frame,
new_frame->width = target_width;
new_frame->height = target_height;
new_frame->data = new char[target_width * target_height * 3 / 2];
new_frame->size = target_width * target_height * 3 / 2;
new_frame->data = new char[new_frame->size];
libyuv::NV12Scale((const uint8_t*)(video_frame->data), video_frame->width,
(const uint8_t*)(video_frame->data +