[FFmpeg-cvslog] id3v2: Fix null ptr crash in get_extra_meta_func()

Michael Niedermayer git at videolan.org
Sat Dec 3 05:34:52 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec  3 05:04:31 2011 +0100| [aedd30b63af8efd5ee6237a6c24dd8cca8851b3c] | committer: Michael Niedermayer

id3v2: Fix null ptr crash in get_extra_meta_func()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aedd30b63af8efd5ee6237a6c24dd8cca8851b3c
---

 libavformat/id3v2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 7797cca..f0a2197 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -409,14 +409,14 @@ static const ID3v2EMFunc *get_extra_meta_func(const char *tag, int isv34)
 {
     int i = 0;
     while (id3v2_extra_meta_funcs[i].tag3) {
-        if (!memcmp(tag,
+        if (tag && !memcmp(tag,
                     (isv34 ? id3v2_extra_meta_funcs[i].tag4 :
                              id3v2_extra_meta_funcs[i].tag3),
                     (isv34 ? 4 : 3)))
             return &id3v2_extra_meta_funcs[i];
         i++;
     }
-    return &id3v2_extra_meta_funcs[i];
+    return NULL;
 }
 
 static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags, ID3v2ExtraMeta **extra_meta)



More information about the ffmpeg-cvslog mailing list