Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit d23ea26

Browse files
committed
make sure input and output files are closed, fixes #35
1 parent 909307c commit d23ea26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

android/ffmpeg-kit-android-lib/src/main/cpp/saf_wrapper.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ static AVIOContext *create_fd_avio_context(const char *filename, int flags) {
9191

9292
static void close_fd_avio_context(AVIOContext *ctx) {
9393
if (ctx) {
94-
if (fd_seek(ctx->opaque, 0, AVSEEK_SIZE) >= 0) {
95-
int *fd = ctx->opaque;
94+
int *fd = ctx->opaque;
95+
if (fd_seek((void*)fd, 0, AVSEEK_SIZE) >= 0) {
9696
closeParcelFileDescriptor(*fd);
9797
av_freep(&fd);
98+
ctx->opaque = NULL;
9899
}
99-
ctx->opaque = NULL;
100100
}
101101
}
102102

0 commit comments

Comments
 (0)