[FFmpeg-soc] [soc]: r5262 - concat/libavformat/avplaylist.c

gkovacs subversion at mplayerhq.hu
Tue Aug 25 09:07:59 CEST 2009


Author: gkovacs
Date: Tue Aug 25 09:07:59 2009
New Revision: 5262

Log:
realloc failure check in av_playlist_add_path

Modified:
   concat/libavformat/avplaylist.c

Modified: concat/libavformat/avplaylist.c
==============================================================================
--- concat/libavformat/avplaylist.c	Tue Aug 25 09:00:59 2009	(r5261)
+++ concat/libavformat/avplaylist.c	Tue Aug 25 09:07:59 2009	(r5262)
@@ -208,7 +208,16 @@ int av_playlist_add_path(AVPlaylistConte
 {
     int64_t *durations_tmp;
     int *nb_streams_list_tmp;
-    ctx->flist = av_realloc(ctx->flist, sizeof(*(ctx->flist)) * (++ctx->pelist_size+1));
+    char **flist_tmp;
+    flist_tmp = av_realloc(ctx->flist, sizeof(*(ctx->flist)) * (++ctx->pelist_size+1));
+    if (!flist_tmp) {
+        av_log(NULL, AV_LOG_ERROR, "av_realloc error in av_playlist_add_path\n");
+        av_free(ctx->durations);
+        ctx->durations = NULL;
+        return AVERROR_NOMEM;
+    }
+    else
+        ctx->flist = flist_tmp;
     ctx->flist[ctx->pelist_size] = NULL;
     ctx->flist[ctx->pelist_size-1] = itempath;
     durations_tmp = av_realloc(ctx->durations,


More information about the FFmpeg-soc mailing list