You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user