diff utils.c @ 8016:81dba4c59fd6 libavcodec

allows calling avcodec_find_(en|de)coder_by_name with NULL parameter
author aurel
date Wed, 08 Oct 2008 17:19:26 +0000
parents b5f5257c0c70
children e70975d5ff80
line wrap: on
line diff
--- a/utils.c	Tue Oct 07 21:41:25 2008 +0000
+++ b/utils.c	Wed Oct 08 17:19:26 2008 +0000
@@ -1009,6 +1009,8 @@
 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_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)