mirror of
https://github.com/mpv-player/mpv
synced 2025-03-06 06:08:23 +00:00
use calloc instead of malloc - simplifies code and fixes overflow problems.
Path by Bjorn Sandell (biorn at chalmers se) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18052 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
9ec42a7e3f
commit
9641a1433c
@ -206,7 +206,6 @@ while(1){
|
||||
break; }
|
||||
case mmioFOURCC('i', 'n', 'd', 'x'): {
|
||||
uint32_t i;
|
||||
unsigned msize = 0;
|
||||
avisuperindex_chunk *s;
|
||||
priv->suidx_size++;
|
||||
priv->suidx = realloc(priv->suidx, priv->suidx_size * sizeof (avisuperindex_chunk));
|
||||
@ -235,11 +234,8 @@ while(1){
|
||||
mp_msg (MSGT_HEADER, MSGL_WARN, "Broken super index chunk size: %u\n",s->wLongsPerEntry);
|
||||
s->wLongsPerEntry = sizeof(avisuperindex_entry)/4;
|
||||
}
|
||||
msize = sizeof (avisuperindex_entry) * s->nEntriesInUse;
|
||||
s->aIndex = malloc(msize);
|
||||
memset (s->aIndex, 0, msize);
|
||||
s->stdidx = malloc (s->nEntriesInUse * sizeof (avistdindex_chunk));
|
||||
memset (s->stdidx, 0, s->nEntriesInUse * sizeof (avistdindex_chunk));
|
||||
s->aIndex = calloc(s->nEntriesInUse, sizeof (avisuperindex_entry));
|
||||
s->stdidx = calloc(s->nEntriesInUse, sizeof (avistdindex_chunk));
|
||||
|
||||
// now the real index of indices
|
||||
for (i=0; i<s->nEntriesInUse; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user