mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter/vf_swaprect: assert that rectangles are within memory
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a88b06f9ee
commit
9d1ba698d2
|
@ -18,6 +18,7 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "libavutil/avassert.h"
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/eval.h"
|
#include "libavutil/eval.h"
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
|
@ -182,6 +183,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
y2[1] = y2[2] = AV_CEIL_RSHIFT(y2[0], s->desc->log2_chroma_h);
|
y2[1] = y2[2] = AV_CEIL_RSHIFT(y2[0], s->desc->log2_chroma_h);
|
||||||
y2[0] = y2[3] = y2[0];
|
y2[0] = y2[3] = y2[0];
|
||||||
|
|
||||||
|
|
||||||
|
av_assert0(FFMAX(x1[1], x2[1]) + pw[1] <= lw[1]);
|
||||||
|
av_assert0(FFMAX(y1[1], y2[1]) + ph[1] <= lh[1]);
|
||||||
|
|
||||||
for (p = 0; p < s->nb_planes; p++) {
|
for (p = 0; p < s->nb_planes; p++) {
|
||||||
if (ph[p] == ah[p] && pw[p] == aw[p]) {
|
if (ph[p] == ah[p] && pw[p] == aw[p]) {
|
||||||
uint8_t *src = in->data[p] + y1[p] * in->linesize[p] + x1[p] * s->pixsteps[p];
|
uint8_t *src = in->data[p] + y1[p] * in->linesize[p] + x1[p] * s->pixsteps[p];
|
||||||
|
|
Loading…
Reference in New Issue