1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-27 10:50:53 +00:00

Fix minor memory leak from 2003

This commit is contained in:
wm4 2012-02-25 17:52:34 +01:00
parent c8efb6d566
commit 8a10f587fc

View File

@ -1505,7 +1505,11 @@ sub_data* sub_read_file(char *filename, float fps, struct MPOpts *opts)
utf16--; utf16--;
mpsub_multiplier = (uses_time ? 100.0 : 1.0); mpsub_multiplier = (uses_time ? 100.0 : 1.0);
if (sub_format==SUB_INVALID) {mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: Could not determine file format\n");return NULL;} if (sub_format==SUB_INVALID) {
mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: Could not determine file format\n");
free_stream(fd);
return NULL;
}
srp=sr+sub_format; srp=sr+sub_format;
mp_msg(MSGT_SUBREADER, MSGL_V, "SUB: Detected subtitle file format: %s\n", srp->name); mp_msg(MSGT_SUBREADER, MSGL_V, "SUB: Detected subtitle file format: %s\n", srp->name);
@ -1533,7 +1537,8 @@ sub_data* sub_read_file(char *filename, float fps, struct MPOpts *opts)
subcp_close(); subcp_close();
sub_utf8=sub_utf8_prev; sub_utf8=sub_utf8_prev;
#endif #endif
return NULL; free_stream(fd);
return NULL;
} }
#ifdef CONFIG_SORTSUB #ifdef CONFIG_SORTSUB
@ -1570,6 +1575,7 @@ sub_data* sub_read_file(char *filename, float fps, struct MPOpts *opts)
#endif #endif
free(first); free(first);
free(alloced_sub); free(alloced_sub);
free_stream(fd);
return NULL; return NULL;
} }
// Apply any post processing that needs recoding first // Apply any post processing that needs recoding first