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

gkovacs subversion at mplayerhq.hu
Mon Aug 24 07:55:16 CEST 2009


Author: gkovacs
Date: Mon Aug 24 07:55:16 2009
New Revision: 5237

Log:
free memory if av_fast_realloc fails

Modified:
   concat/libavformat/avplaylist.c

Modified: concat/libavformat/avplaylist.c
==============================================================================
--- concat/libavformat/avplaylist.c	Mon Aug 24 07:43:44 2009	(r5236)
+++ concat/libavformat/avplaylist.c	Mon Aug 24 07:55:16 2009	(r5237)
@@ -135,12 +135,15 @@ void av_playlist_split_encodedstring(con
     ts = s;
     while ((c = *ts++) != 0) {
         if (c == sep) {
+            int *sepidx_tmp;
             sepidx[len] = ts-s;
-            sepidx = av_fast_realloc(sepidx, &buflen, ++len);
-            if (!sepidx) {
+            sepidx_tmp = av_fast_realloc(sepidx, &buflen, ++len);
+            if (!sepidx_tmp) {
+                free(sepidx);
                 av_log(NULL, AV_LOG_ERROR, "av_fast_realloc error in av_playlist_split_encodedstring\n");
                 continue;
-            }
+            } else
+                sepidx = sepidx_tmp;
         }
     }
     sepidx[len] = ts-s;


More information about the FFmpeg-soc mailing list