avilib: free malloc'ed memory for super indexes

This commit is contained in:
Moritz Bunkus 2018-04-16 21:32:55 +02:00
parent 9867210534
commit 045fb9df48
2 changed files with 11 additions and 0 deletions

View File

@ -40,6 +40,8 @@
* mkvpropedit: removed a small, constant-size memory leak when deleting
properties.
* mkvmerge: chapter handling: removed a small, constant-size memory leak.
* mkvmerge, mkvextract: AVI handling: removed a small, constant-size memory
leak when dealing with indexes in AVIs.
## Build system changes

View File

@ -1951,6 +1951,15 @@ int AVI_close(avi_t *AVI)
if(AVI->video_index) free(AVI->video_index);
if(AVI->video_superindex) {
if(AVI->video_superindex->aIndex) free(AVI->video_superindex->aIndex);
if (AVI->video_superindex->stdindex) {
for (j = 0; j < NR_IXNN_CHUNKS; j++)
if (AVI->video_superindex->stdindex[j]) {
if ((j < AVI->video_superindex->nEntriesInUse) && AVI->video_superindex->stdindex[j]->aIndex)
free(AVI->video_superindex->stdindex[j]->aIndex);
free(AVI->video_superindex->stdindex[j]);
}
free(AVI->video_superindex->stdindex);
}
free(AVI->video_superindex);
}