Commit f4a946f0 authored by aurel's avatar aurel

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15586 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent caa1486d
...@@ -1009,6 +1009,8 @@ AVCodec *avcodec_find_encoder(enum CodecID id) ...@@ -1009,6 +1009,8 @@ AVCodec *avcodec_find_encoder(enum CodecID id)
AVCodec *avcodec_find_encoder_by_name(const char *name) AVCodec *avcodec_find_encoder_by_name(const char *name)
{ {
AVCodec *p; AVCodec *p;
if (!name)
return NULL;
p = first_avcodec; p = first_avcodec;
while (p) { while (p) {
if (p->encode != NULL && strcmp(name,p->name) == 0) if (p->encode != NULL && strcmp(name,p->name) == 0)
...@@ -1033,6 +1035,8 @@ AVCodec *avcodec_find_decoder(enum CodecID id) ...@@ -1033,6 +1035,8 @@ AVCodec *avcodec_find_decoder(enum CodecID id)
AVCodec *avcodec_find_decoder_by_name(const char *name) AVCodec *avcodec_find_decoder_by_name(const char *name)
{ {
AVCodec *p; AVCodec *p;
if (!name)
return NULL;
p = first_avcodec; p = first_avcodec;
while (p) { while (p) {
if (p->decode != NULL && strcmp(name,p->name) == 0) if (p->decode != NULL && strcmp(name,p->name) == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment