diff --git a/src/media/resolution_adapter/resolution_adapter.cpp b/src/media/resolution_adapter/resolution_adapter.cpp index 0d47ec4..c9d0996 100644 --- a/src/media/resolution_adapter/resolution_adapter.cpp +++ b/src/media/resolution_adapter/resolution_adapter.cpp @@ -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 + diff --git a/src/transport/ice_transport_controller.cpp b/src/transport/ice_transport_controller.cpp index 20a88d0..830aaeb 100644 --- a/src/transport/ice_transport_controller.cpp +++ b/src/transport/ice_transport_controller.cpp @@ -144,6 +144,7 @@ int IceTransportController::SendVideo(const XVideoFrame* video_frame) { new_frame.data = nullptr; new_frame.width = video_frame->width; new_frame.height = video_frame->height; + new_frame.size = video_frame->size; if (target_width_.has_value() && target_height_.has_value()) { if (target_width_.value() < video_frame->width && target_height_.value() < video_frame->height) {