summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
Diffstat (limited to 'sub')
-rw-r--r--sub/spudec.c2
-rw-r--r--sub/subreader.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/sub/spudec.c b/sub/spudec.c
index 2dd030f54a..003a068422 100644
--- a/sub/spudec.c
+++ b/sub/spudec.c
@@ -170,7 +170,9 @@ static int spudec_alloc_image(spudec_handle_t *this, int stride, int height)
if (this->image_size < this->stride * this->height) {
if (this->image != NULL) {
free(this->image);
+ this->image = NULL;
free(this->pal_image);
+ this->pal_image = NULL;
this->image_size = 0;
this->pal_width = this->pal_height = 0;
}
diff --git a/sub/subreader.c b/sub/subreader.c
index 2ecc41c346..1f88b220d1 100644
--- a/sub/subreader.c
+++ b/sub/subreader.c
@@ -1106,9 +1106,11 @@ static subtitle *sub_read_line_jacosub(stream_t* st, subtitle * current,
} //-- switch
} //-- for
*q = '\0';
- current->text[current->lines] = strdup(line1);
+ if (current->lines < SUB_MAX_TEXT)
+ current->text[current->lines] = strdup(line1);
} //-- while
- current->lines++;
+ if (current->lines < SUB_MAX_TEXT)
+ current->lines++;
return current;
}