[FFmpeg-soc] [soc]: r4650 - concat/libavformat/pls.c

gkovacs subversion at mplayerhq.hu
Tue Jul 7 04:21:30 CEST 2009


Author: gkovacs
Date: Tue Jul  7 04:21:29 2009
New Revision: 4650

Log:
added null check and error handling in pls

Modified:
   concat/libavformat/pls.c

Modified: concat/libavformat/pls.c
==============================================================================
--- concat/libavformat/pls.c	Tue Jul  7 03:48:25 2009	(r4649)
+++ concat/libavformat/pls.c	Tue Jul  7 04:21:29 2009	(r4650)
@@ -87,6 +87,8 @@ static int pls_list_files(ByteIOContext 
             }
         }
     }
+    if (!flist) // no files have been found
+        return AVERROR_EOF;
     flist[j] = 0;
     ctx->pelist_size = j;
     ff_playlist_relative_paths(flist, ctx->workingdir);
@@ -105,7 +107,10 @@ static int pls_read_header(AVFormatConte
 {
     int i;
     PlaylistContext *ctx = ff_playlist_alloc_context(s->filename);
-    pls_list_files(s->pb, ctx);
+    if (pls_list_files(s->pb, ctx)) {
+        fprintf(stderr, "no playlist items found in %s\n", s->filename);
+        return AVERROR_EOF;
+    }
     s->priv_data = ctx;
     for (i = 0; i < ctx->pe_curidxs_size; ++i) {
         ff_playlist_populate_context(ctx, s, i);


More information about the FFmpeg-soc mailing list