openFileDescriptor() can return null in certain error conditions.
Unified · Split
| @@ -621,6 +621,11 @@ static int android_content_open(URLContext *h, const char *filename, int flags) · 620 unmodified lines | |||
| 621 | ret = ff_jni_exception_check(env, 1, c); | 621 | ret = ff_jni_exception_check(env, 1, c); |
| 622 | if (ret < 0) | 622 | if (ret < 0) |
| 623 | goto done; | 623 | 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 | } | ||
| 624 | 629 | ||
| 625 | fd = (*env)->CallIntMethod(env, parcel_file_descriptor, jfields.detach_fd_id); | 630 | fd = (*env)->CallIntMethod(env, parcel_file_descriptor, jfields.detach_fd_id); |
| 626 | ret = ff_jni_exception_check(env, 1, c); | 631 | ret = ff_jni_exception_check(env, 1, c); |