aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-10-08 17:19:26 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-10-08 17:19:26 +0000
commitfc228c9014c5875d34190642ec9273d4a254efdf (patch)
tree0067e5c6bebf4ef856e16612ceafcce290fb7b56 /libavcodec/utils.c
parent13394e8cbb86817958b2201f7261829b6c9703fd (diff)
downloadffmpeg-fc228c9014c5875d34190642ec9273d4a254efdf.tar.gz
allows calling avcodec_find_(en|de)coder_by_name with NULL parameter
Originally committed as revision 15586 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 31a5d37347..cc2a3a2a8d 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1009,6 +1009,8 @@ AVCodec *avcodec_find_encoder(enum CodecID id)
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 CodecID id)
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)