aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/imgconvert.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2008-08-03 00:41:31 +0000
committerPeter Ross <pross@xvid.org>2008-08-03 00:41:31 +0000
commit42a45a03e79ca235ac4391d7570f5fc9163688e4 (patch)
treea7f9e5aa6f6c7c298d9781ad56cacf36a41d6fde /libavcodec/imgconvert.c
parenta79db0f7c47701d46ec864b6b2dfeea03160a106 (diff)
downloadffmpeg-42a45a03e79ca235ac4391d7570f5fc9163688e4.tar.gz
Add graceful error handling to avcodec_get_pix_fmt_name() and avcodec_get_pix_fmt().
Originally committed as revision 14513 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r--libavcodec/imgconvert.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 6ef00c9100..63c59d42dd 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -390,7 +390,7 @@ void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift)
const char *avcodec_get_pix_fmt_name(int pix_fmt)
{
if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB)
- return "???";
+ return NULL;
else
return pix_fmt_info[pix_fmt].name;
}
@@ -401,8 +401,8 @@ enum PixelFormat avcodec_get_pix_fmt(const char* name)
for (i=0; i < PIX_FMT_NB; i++)
if (!strcmp(pix_fmt_info[i].name, name))
- break;
- return i;
+ return i;
+ return PIX_FMT_NONE;
}
void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt)