[FFmpeg-cvslog] r15586 - trunk/libavcodec/utils.c

aurel subversion
Wed Oct 8 19:19:27 CEST 2008


Author: aurel
Date: Wed Oct  8 19:19:26 2008
New Revision: 15586

Log:
allows calling avcodec_find_(en|de)coder_by_name with NULL parameter


Modified:
   trunk/libavcodec/utils.c

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	(original)
+++ trunk/libavcodec/utils.c	Wed Oct  8 19:19:26 2008
@@ -1009,6 +1009,8 @@ AVCodec *avcodec_find_encoder(enum Codec
 AVCodec *avcodec_find_encoder_by_name(const char *name)
 {
     AVCodec *p;
+    if (!name)
+        return NULL;
     p = first_avcodec;
     while (p) {
         if (p->encode != NULL && strcmp(name,p->name) == 0)
@@ -1033,6 +1035,8 @@ AVCodec *avcodec_find_decoder(enum Codec
 AVCodec *avcodec_find_decoder_by_name(const char *name)
 {
     AVCodec *p;
+    if (!name)
+        return NULL;
     p = first_avcodec;
     while (p) {
         if (p->decode != NULL && strcmp(name,p->name) == 0)




More information about the ffmpeg-cvslog mailing list