History

avformat/file: add missing null check in Android content resolver

openFileDescriptor() can return null in certain error conditions.

sfan5 committed 1 year ago

Commit 1a61db91 parent 2a49d051 file · +5 −0Browse files

Unified · Split

libavformat/file.c+5−0
@@ -621,6 +621,11 @@ static int android_content_open(URLContext *h, const char *filename, int flags) · 620 unmodified lines
621621 ret = ff_jni_exception_check(env, 1, c);
622622 if (ret < 0)
623623 goto done;
624+ if (!parcel_file_descriptor) {
625+ av_log(c, AV_LOG_ERROR, "file descriptor is null\n");
626+ ret = AVERROR_EXTERNAL;
627+ goto done;
628+ }
624629
625630 fd = (*env)->CallIntMethod(env, parcel_file_descriptor, jfields.detach_fd_id);
626631 ret = ff_jni_exception_check(env, 1, c);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t