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

Issue 2780273002: Fix JNI reference leak in MediaCodecVideoDecoder (Closed)

Created:
3 years, 8 months ago by magjed_webrtc
Modified:
3 years, 8 months ago
Reviewers:
sakal
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Fix JNI reference leak in MediaCodecVideoDecoder We currently leak one local reference to MediaCodecVideoDecoder in every call to MediaCodecVideoDecoderFactory::CreateVideoDecoder. After the decoder has been re-initialized 512 times, JNI will crash due to local reference table overflow (max=512). The actual leak is in the member initializer list of MediaCodecVideoDecoder. This CL fixes the leak by adding a ScopedLocalRefFrame outside of the ctor. All JNI code that originate from a C++ thread (i.e. the entry point is not a Java thread) must use a ScopedLocalRefFrame in order to avoid leaking local references. BUG=webrtc:6969 ,b/36713034 Review-Url: https://codereview.webrtc.org/2780273002 Cr-Commit-Position: refs/heads/master@{#17464} Committed: https://chromium.googlesource.com/external/webrtc/+/e4cd15d379b1a0bf1f91aaf873cfa07b0998f295

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -3 lines) Patch
M webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 13 (9 generated)
magjed_webrtc
Sami - please take a look.
3 years, 8 months ago (2017-03-29 20:10:57 UTC) #5
sakal
lgtm
3 years, 8 months ago (2017-03-30 07:18:25 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2780273002/1
3 years, 8 months ago (2017-03-30 08:04:24 UTC) #10
commit-bot: I haz the power
3 years, 8 months ago (2017-03-30 08:08:41 UTC) #13
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/external/webrtc/+/e4cd15d379b1a0bf1f91aaf87...

Powered by Google App Engine
This is Rietveld 408576698