Optimize / simplify avcodec_get_pix_fmt_name() check.

Originally committed as revision 25689 to svn://svn.ffmpeg.org/ffmpeg/trunk
oldabi
Stefano Sabatini 14 years ago
parent a5f27f6db8
commit 46db10ed0e
  1. 2
      libavcodec/imgconvert.c

@ -419,7 +419,7 @@ void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *
const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt)
{
if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB)
if ((unsigned)pix_fmt >= PIX_FMT_NB)
return NULL;
else
return av_pix_fmt_descriptors[pix_fmt].name;

Loading…
Cancel
Save