diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-04-17 15:15:12 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-04-17 15:16:48 +0000 |
commit | 716588188d87178d4b850982b5b361150cb7e94c (patch) | |
tree | bd15cb13fad5cb2d1dc58117885c8ca9503e89a2 /libavfilter | |
parent | 2787f7b188f5e92bc9dc945035e2e0729f7669cd (diff) | |
download | ffmpeg-716588188d87178d4b850982b5b361150cb7e94c.tar.gz |
lavfi/stereo3d: check input width & height
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_stereo3d.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c index c387684a23..09d4554b83 100644 --- a/libavfilter/vf_stereo3d.c +++ b/libavfilter/vf_stereo3d.c @@ -196,6 +196,34 @@ static int config_output(AVFilterLink *outlink) Stereo3DContext *s = ctx->priv; AVRational aspect = inlink->sample_aspect_ratio; + switch (s->in.format) { + case SIDE_BY_SIDE_2_LR: + case SIDE_BY_SIDE_LR: + case SIDE_BY_SIDE_2_RL: + case SIDE_BY_SIDE_RL: + if (inlink->w & 1) { + av_log(ctx, AV_LOG_ERROR, "width must be even\n"); + return AVERROR_INVALIDDATA; + } + break; + case ABOVE_BELOW_2_LR: + case ABOVE_BELOW_LR: + case ABOVE_BELOW_2_RL: + case ABOVE_BELOW_RL: + if (s->out.format == INTERLEAVE_ROWS_LR || + s->out.format == INTERLEAVE_ROWS_RL) { + if (inlink->h & 3) { + av_log(ctx, AV_LOG_ERROR, "height must be multiple of 4\n"); + return AVERROR_INVALIDDATA; + } + } + if (inlink->h & 1) { + av_log(ctx, AV_LOG_ERROR, "height must be even\n"); + return AVERROR_INVALIDDATA; + } + break; + } + s->in.width = s->width = inlink->w; s->in.height = |