swscale: Allow chroma samples to be above and to the left of luma samples

Found-by: Kierank
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-09-21 12:12:50 +02:00
parent 950ce21d4a
commit 61af6bebb4
3 changed files with 6 additions and 6 deletions

View File

@@ -266,7 +266,7 @@ static double getSplineCoeff(double a, double b, double c, double d,
static av_cold int get_local_pos(SwsContext *s, int chr_subsample, int pos, int dir)
{
if (pos < 0) {
if (pos == -1 || pos <= -513) {
pos = (128 << chr_subsample) - 128;
}
pos += 128; // relative to ideal left edge