avformat/file: add missing null check in Android content resolver
openFileDescriptor() can return null in certain error conditions. Signed-off-by: sfan5 <sfan5@live.de> Reviewed-by: Kacper Michajłow <kasper93@gmail.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
parent
2a49d05d1a
commit
1a61db9797
1 changed files with 5 additions and 0 deletions
|
|
@ -621,6 +621,11 @@ static int android_content_open(URLContext *h, const char *filename, int flags)
|
|||
ret = ff_jni_exception_check(env, 1, c);
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
if (!parcel_file_descriptor) {
|
||||
av_log(c, AV_LOG_ERROR, "file descriptor is null\n");
|
||||
ret = AVERROR_EXTERNAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
fd = (*env)->CallIntMethod(env, parcel_file_descriptor, jfields.detach_fd_id);
|
||||
ret = ff_jni_exception_check(env, 1, c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue