From 293ed23f1201d33a9510cf062213faa51ef620d4 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 27 Apr 2004 02:55:05 +0000 Subject: [PATCH] NULL pointers ... Originally committed as revision 3080 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index ee91b42f19..ff04435133 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -48,6 +48,9 @@ int match_ext(const char *filename, const char *extensions) const char *ext, *p; char ext1[32], *q; + if(!filename) + return 0; + ext = strrchr(filename, '.'); if (ext) { ext++; @@ -264,6 +267,8 @@ void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr) int filename_number_test(const char *filename) { char buf[1024]; + if(!filename) + return -1; return get_frame_filename(buf, sizeof(buf), filename, 1); }