Commit 5b32558f authored by Michael Niedermayer's avatar Michael Niedermayer

tools/sidxindex: Use av_*malloc_array()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c49e7924
...@@ -156,8 +156,8 @@ static int handle_file(struct Tracks *tracks, const char *file) ...@@ -156,8 +156,8 @@ static int handle_file(struct Tracks *tracks, const char *file)
err = AVERROR(ENOMEM); err = AVERROR(ENOMEM);
goto fail; goto fail;
} }
temp = av_realloc(tracks->tracks, temp = av_realloc_array(tracks->tracks, tracks->nb_tracks + 1,
sizeof(*tracks->tracks) * (tracks->nb_tracks + 1)); sizeof(*tracks->tracks));
if (!temp) { if (!temp) {
av_free(track); av_free(track);
err = AVERROR(ENOMEM); err = AVERROR(ENOMEM);
...@@ -244,7 +244,7 @@ static int output_mpd(struct Tracks *tracks, const char *filename) ...@@ -244,7 +244,7 @@ static int output_mpd(struct Tracks *tracks, const char *filename)
nb_tracks = nb_tracks_buf; nb_tracks = nb_tracks_buf;
nb_sets = 2; nb_sets = 2;
for (i = 0; i < 2; i++) { 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]) { if (!adaptation_sets[i]) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto err; goto err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment