mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-22 15:27:55 +08:00
allows calling avcodec_find_(en|de)coder_by_name with NULL parameter
Originally committed as revision 15586 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -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)
|
|||||||
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)
|
||||||
|
Reference in New Issue
Block a user