aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-27 18:22:09 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-27 18:22:09 +0200
commit1853e2cba9b2f9dc343a80286f1c04d6a9d6cecf (patch)
tree47eb6a21b21fa2fbea6337141b23fde14e3fe8dc
parent0d26264fb4c8fbf3f26692270e77f71633d4b103 (diff)
downloadffmpeg-1853e2cba9b2f9dc343a80286f1c04d6a9d6cecf.tar.gz
avfilter/formats: Avoid using non public AV_SAMPLE_FMT_NB
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/formats.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index 141390f22c..9b4a6a7cfc 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -376,7 +376,7 @@ AVFilterFormats *ff_planar_sample_fmts(void)
AVFilterFormats *ret = NULL;
int fmt;
- for (fmt = 0; fmt < AV_SAMPLE_FMT_NB; fmt++)
+ for (fmt = 0; av_get_bytes_per_sample(fmt)>0; fmt++)
if (av_sample_fmt_is_planar(fmt))
ff_add_format(&ret, fmt);
@@ -587,7 +587,7 @@ int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx)
int sfmt = av_get_sample_fmt(arg);
if (sfmt == AV_SAMPLE_FMT_NONE) {
sfmt = strtol(arg, &tail, 0);
- if (*tail || (unsigned)sfmt >= AV_SAMPLE_FMT_NB) {
+ if (*tail || av_get_bytes_per_sample(sfmt)<=0) {
av_log(log_ctx, AV_LOG_ERROR, "Invalid sample format '%s'\n", arg);
return AVERROR(EINVAL);
}