Avoid a segfault if max_idx has been set before. Fix for bug 256.

This commit is contained in:
Moritz Bunkus 2007-08-30 19:02:00 +00:00
parent e00a819078
commit 4a8dcc0468
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-08-30 Moritz Bunkus <moritz@bunkus.org>
* avilib: bug fix: Fixed a segmentation fault if reading the first
part of an index failed but a second/other index part is
present. Fix for bug 256.
2007-08-19 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: enhancement: SRT files that contain coordinates in the

View File

@ -574,7 +574,7 @@ static int avi_add_index_entry(avi_t *AVI, unsigned char *tag, long flags, unsig
{
void *ptr;
if(AVI->n_idx>=AVI->max_idx) {
if(!AVI->idx || (AVI->n_idx>=AVI->max_idx)) {
ptr = realloc((void *)AVI->idx,(AVI->max_idx+4096)*16);
if(ptr == 0) {