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

gkovacs subversion at mplayerhq.hu
Sun Aug 30 01:18:55 CEST 2009


Author: gkovacs
Date: Sun Aug 30 01:18:55 2009
New Revision: 5367

Log:
fix indexing issue while shifting flist down in remove_item

Modified:
   concat/libavformat/avplaylist.c

Modified: concat/libavformat/avplaylist.c
==============================================================================
--- concat/libavformat/avplaylist.c	Sun Aug 30 01:16:28 2009	(r5366)
+++ concat/libavformat/avplaylist.c	Sun Aug 30 01:18:55 2009	(r5367)
@@ -140,10 +140,11 @@ int av_playlist_remove_item(AVPlaylistCo
     char **flist_tmp;
     if (pos >= ctx->pelist_size || !ctx->flist || !ctx->durations || !ctx->nb_streams_list)
         return AVERROR_INVALIDDATA;
+    --ctx->pelist_size;
     av_free(ctx->flist[pos]);
     for (i = pos; i < ctx->pelist_size; ++i)
         ctx->flist[i] = ctx->flist[i + 1];
-    flist_tmp = av_realloc(ctx->flist, sizeof(*(ctx->flist)) * (--ctx->pelist_size));
+    flist_tmp = av_realloc(ctx->flist, sizeof(*(ctx->flist)) * (ctx->pelist_size));
     if (!flist_tmp) {
         av_log(NULL, AV_LOG_ERROR,
                "av_realloc error for flist in av_playlist_remove_item\n");


More information about the FFmpeg-soc mailing list