diff mbox

[FFmpeg-devel,02/11] avfilter/vf_scale_npp: fix out-of-bounds reads

Message ID 20170611140551.11844-2-timo@rothenpieler.org
State Accepted
Commit 0fbc9bbbbb39b9a6f62d57f237052b64eefac578
Headers show

Commit Message

Timo Rothenpieler June 11, 2017, 2:05 p.m. UTC
Fixes CIDs 1396414 and 1396415
---
 libavfilter/vf_scale_npp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Timo Rothenpieler June 13, 2017, 5:53 p.m. UTC | #1
applied
diff mbox

Patch

diff --git a/libavfilter/vf_scale_npp.c b/libavfilter/vf_scale_npp.c
index b5acce653b..c36772e800 100644
--- a/libavfilter/vf_scale_npp.c
+++ b/libavfilter/vf_scale_npp.c
@@ -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;