libavfilter/scale2ref: Fix out-of-bounds array access
authorKevin Mark <kmark937@gmail.com>
Sat, 3 Jun 2017 09:04:19 +0000 (05:04 -0400)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 3 Jun 2017 21:14:04 +0000 (23:14 +0200)
commit08213e0b7974b7e75d9031d6e448be49a494c0a1
treebd68adf2f5402bd4f3f998efedb78a813aaee26e
parentbe3809a521fecfd3a61db99d660f243bd32b30bb
libavfilter/scale2ref: Fix out-of-bounds array access

ff_scale_eval_dimensions blindly assumes that two inputs are always
available as of 3385989b98be7940044e4f0a6b431a0a00abf2fa. This is
notably not the case when the function is called for the scale
filter. With the scale filter inputs[1] does not exist.

ff_scale_eval_dimensions now has an updated scale2ref check that
makes certain two inputs are actually available before attempting to
access the second one.

Thanks to James Almer for reporting this bug. This should fix the 820
Valgrind tests I single-handedly managed to break.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/scale.c