Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: webrtc/api/java/jni/peerconnection_jni.cc

Issue 1941773002: Fix allocation size in CricketToJavaI420Frame, taking stride into account. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/java/jni/peerconnection_jni.cc
diff --git a/webrtc/api/java/jni/peerconnection_jni.cc b/webrtc/api/java/jni/peerconnection_jni.cc
index 10b8134ef425332baf8ae9fadb94d84ed850111a..ac328efc2b13d2e15c6a22878ba62cea11aebcc9 100644
--- a/webrtc/api/java/jni/peerconnection_jni.cc
+++ b/webrtc/api/java/jni/peerconnection_jni.cc
@@ -771,14 +771,14 @@ class JavaVideoRendererWrapper
const_cast<uint8_t*>(frame->video_frame_buffer()->DataY()),
frame->video_frame_buffer()->StrideY() *
frame->video_frame_buffer()->height());
- size_t chroma_size =
- ((frame->width() + 1) / 2) * ((frame->height() + 1) / 2);
+ size_t chroma_height = (frame->height() + 1) / 2;
jobject u_buffer = jni()->NewDirectByteBuffer(
const_cast<uint8_t*>(frame->video_frame_buffer()->DataU()),
- chroma_size);
+ frame->video_frame_buffer()->StrideU() * chroma_height);
jobject v_buffer = jni()->NewDirectByteBuffer(
const_cast<uint8_t*>(frame->video_frame_buffer()->DataV()),
- chroma_size);
+ frame->video_frame_buffer()->StrideV() * chroma_height);
+
jni()->SetObjectArrayElement(planes, 0, y_buffer);
jni()->SetObjectArrayElement(planes, 1, u_buffer);
jni()->SetObjectArrayElement(planes, 2, v_buffer);
@@ -1888,7 +1888,7 @@ JOW(void, VideoRenderer_nativeCopyPlane)(
RTC_CHECK(src_size >= src_stride * height)
<< "Insufficient source buffer capacity " << src_size;
RTC_CHECK(dst_size >= dst_stride * height)
- << "Isufficient destination buffer capacity " << dst_size;
+ << "Insufficient destination buffer capacity " << dst_size;
uint8_t *src =
reinterpret_cast<uint8_t*>(jni->GetDirectBufferAddress(j_src_buffer));
uint8_t *dst =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698