From 885c6a2610619ad3ee2b01ae7ec7670f8551d388 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 6 May 2013 20:58:54 +0200 Subject: Fix some cppcheck / scan-build warnings These were found by the cppcheck and scan-build static analyzers. Most of these aren't interesting (the 2 previous commits fix some interesting cases found by these analyzers), and they don't nearly fix all warnings. (Most of the unfixed warnings are spam, things MPlayer never cared about, or false positives.) --- sub/find_subfiles.c | 1 - sub/subreader.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'sub') diff --git a/sub/find_subfiles.c b/sub/find_subfiles.c index aa8df2ea49..e77015114b 100644 --- a/sub/find_subfiles.c +++ b/sub/find_subfiles.c @@ -69,7 +69,6 @@ static struct bstr guess_lang_from_filename(struct bstr name) struct sub_list { struct subfn subs[MAX_SUBTITLE_FILES]; - int sid; void *ctx; }; diff --git a/sub/subreader.c b/sub/subreader.c index a109d0c362..090cd0a8b4 100644 --- a/sub/subreader.c +++ b/sub/subreader.c @@ -1511,7 +1511,7 @@ if ((suboverlap_enabled == 2) || // from a block of sub_to_add+1 subs placeholder = malloc(sizeof(int *) * counter); for (i = 0; i < counter; ++i) { - placeholder[i] = malloc(sizeof(int) * lines_to_add); + placeholder[i] = malloc(sizeof(int) * lines_to_add + 1); for (j = 0; j < lines_to_add; ++j) { placeholder[i][j] = -1; } -- cgit v1.2.3