aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Niedermayer2013-03-14 12:02:43 +0100
committerMichael Niedermayer2013-03-14 12:15:02 +0100
commit905e7eb41389e4394e9c6e459b7d1a99dc30b075 (patch)
tree1d182a4e747144648ab74c4a7dfcc88395aa7c29 /tools
parent360d71707f7d3b1c02be857515392a843f159b85 (diff)
parentf099d3d1d5466bd63f4ab36270d169ff9ea613b8 (diff)
Merge commit 'f099d3d1d5466bd63f4ab36270d169ff9ea613b8'
* commit 'f099d3d1d5466bd63f4ab36270d169ff9ea613b8': Add av_log_{ask_for_sample|missing_feature} replacements to libavutil ismindex: Check the return value of allocations Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'tools')
-rw-r--r--tools/ismindex.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/ismindex.c b/tools/ismindex.c
index 540aca2c68..502a7dc2b1 100644
--- a/tools/ismindex.c
+++ b/tools/ismindex.c
@@ -305,10 +305,21 @@ static int handle_file(struct Tracks *tracks, const char *file, int split)
tracks->duration = ctx->duration;
for (i = 0; i < ctx->nb_streams; i++) {
+ struct Track **temp;
AVStream *st = ctx->streams[i];
track = av_mallocz(sizeof(*track));
- tracks->tracks = av_realloc(tracks->tracks,
- sizeof(*tracks->tracks) * (tracks->nb_tracks + 1));
+ if (!track) {
+ err = AVERROR(ENOMEM);
+ goto fail;
+ }
+ temp = av_realloc(tracks->tracks,
+ sizeof(*tracks->tracks) * (tracks->nb_tracks + 1));
+ if (!temp) {
+ av_free(track);
+ err = AVERROR(ENOMEM);
+ goto fail;
+ }
+ tracks->tracks = temp;
tracks->tracks[tracks->nb_tracks] = track;
track->name = file;