Browse Source

tools/sidxindex: Use av_*malloc_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.7
Michael Niedermayer 10 years ago
parent
commit
5b32558fd8
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      tools/sidxindex.c

+ 3
- 3
tools/sidxindex.c View File

@@ -156,8 +156,8 @@ static int handle_file(struct Tracks *tracks, const char *file)
err = AVERROR(ENOMEM);
goto fail;
}
temp = av_realloc(tracks->tracks,
sizeof(*tracks->tracks) * (tracks->nb_tracks + 1));
temp = av_realloc_array(tracks->tracks, tracks->nb_tracks + 1,
sizeof(*tracks->tracks));
if (!temp) {
av_free(track);
err = AVERROR(ENOMEM);
@@ -244,7 +244,7 @@ static int output_mpd(struct Tracks *tracks, const char *filename)
nb_tracks = nb_tracks_buf;
nb_sets = 2;
for (i = 0; i < 2; i++) {
adaptation_sets[i] = av_malloc(sizeof(*adaptation_sets[i]) * tracks->nb_tracks);
adaptation_sets[i] = av_malloc_array(tracks->nb_tracks, sizeof(*adaptation_sets[i]));
if (!adaptation_sets[i]) {
ret = AVERROR(ENOMEM);
goto err;


Loading…
Cancel
Save