avfilter/formats: Avoid using non public AV_PIX_FMT_NB
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 27 May 2014 15:43:03 +0000 (17:43 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 27 May 2014 15:43:03 +0000 (17:43 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/formats.c

index dbd8bd9..141390f 100644 (file)
@@ -572,7 +572,7 @@ int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ct
     int pix_fmt = av_get_pix_fmt(arg);
     if (pix_fmt == AV_PIX_FMT_NONE) {
         pix_fmt = strtol(arg, &tail, 0);
-        if (*tail || (unsigned)pix_fmt >= AV_PIX_FMT_NB) {
+        if (*tail || !av_pix_fmt_desc_get(pix_fmt)) {
             av_log(log_ctx, AV_LOG_ERROR, "Invalid pixel format '%s'\n", arg);
             return AVERROR(EINVAL);
         }