avfilter/vf_scale_npp: fix out-of-bounds reads

Fixes CIDs 1396414 and 1396415
This commit is contained in:
Timo Rothenpieler 2017-06-11 14:56:44 +02:00
parent 21583e936a
commit 0fbc9bbbbb

View File

@ -400,7 +400,7 @@ static int nppscale_resize(AVFilterContext *ctx, NPPScaleStageContext *stage,
NppStatus err;
int i;
for (i = 0; i < FF_ARRAY_ELEMS(in->data) && in->data[i]; i++) {
for (i = 0; i < FF_ARRAY_ELEMS(stage->planes_in) && i < FF_ARRAY_ELEMS(in->data) && in->data[i]; i++) {
int iw = stage->planes_in[i].width;
int ih = stage->planes_in[i].height;
int ow = stage->planes_out[i].width;