Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b11cd7d1
Commit
b11cd7d1
authored
Jul 27, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mediacodec: jni: fix GET_INTEGER crashes
It happens when fetching the "channel-mask" property.
parent
c82f5248
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
modules/codec/omxil/mediacodec_jni.c
modules/codec/omxil/mediacodec_jni.c
+18
-10
No files found.
modules/codec/omxil/mediacodec_jni.c
View file @
b11cd7d1
...
...
@@ -143,16 +143,6 @@ static const struct member members[] = {
{
NULL
,
NULL
,
NULL
,
0
,
0
,
false
},
};
static
inline
int
get_integer
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
psz_name
)
{
int
i_ret
;
jstring
jname
=
(
*
env
)
->
NewStringUTF
(
env
,
psz_name
);
i_ret
=
(
*
env
)
->
CallIntMethod
(
env
,
obj
,
jfields
.
get_integer
,
jname
);
(
*
env
)
->
DeleteLocalRef
(
env
,
jname
);
return
i_ret
;
}
#define GET_INTEGER(obj, name) get_integer(env, obj, name)
static
int
jstrcmp
(
JNIEnv
*
env
,
jobject
str
,
const
char
*
str2
)
{
jsize
len
=
(
*
env
)
->
GetStringUTFLength
(
env
,
str
);
...
...
@@ -177,6 +167,24 @@ static inline bool check_exception(JNIEnv *env)
#define CHECK_EXCEPTION() check_exception( env )
#define GET_ENV() if (!(env = android_getEnv(api->p_obj, THREAD_NAME))) return VLC_EGENERIC;
static
inline
int
get_integer
(
JNIEnv
*
env
,
jobject
obj
,
const
char
*
psz_name
)
{
jstring
jname
=
(
*
env
)
->
NewStringUTF
(
env
,
psz_name
);
if
(
!
CHECK_EXCEPTION
()
&&
jname
)
{
int
i_ret
=
(
*
env
)
->
CallIntMethod
(
env
,
obj
,
jfields
.
get_integer
,
jname
);
(
*
env
)
->
DeleteLocalRef
(
env
,
jname
);
/* getInteger can throw NullPointerException (when fetching the
* "channel-mask" property for example) */
if
(
CHECK_EXCEPTION
())
return
0
;
return
i_ret
;
}
else
return
0
;
}
#define GET_INTEGER(obj, name) get_integer(env, obj, name)
/* Initialize all jni fields.
* Done only one time during the first initialisation */
static
bool
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment