avfilter/vf_mix: use correct linesizes
authorPaul B Mahol <onemda@gmail.com>
Fri, 27 Apr 2018 17:15:55 +0000 (19:15 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 27 Apr 2018 17:15:55 +0000 (19:15 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_mix.c

index 37c592f..9ae61c5 100644 (file)
@@ -143,7 +143,7 @@ static int mix_frames(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
                     int val = 0;
 
                     for (i = 0; i < s->nb_inputs; i++) {
                     int val = 0;
 
                     for (i = 0; i < s->nb_inputs; i++) {
-                        uint8_t src = in[i]->data[p][y * s->linesize[p] + x];
+                        uint8_t src = in[i]->data[p][y * in[i]->linesize[p] + x];
 
                         val += src * s->weights[i];
                     }
 
                         val += src * s->weights[i];
                     }
@@ -165,7 +165,7 @@ static int mix_frames(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
                     int val = 0;
 
                     for (i = 0; i < s->nb_inputs; i++) {
                     int val = 0;
 
                     for (i = 0; i < s->nb_inputs; i++) {
-                        uint16_t src = AV_RN16(in[i]->data[p] + y * s->linesize[p] + x * 2);
+                        uint16_t src = AV_RN16(in[i]->data[p] + y * in[i]->linesize[p] + x * 2);
 
                         val += src * s->weights[i];
                     }
 
                         val += src * s->weights[i];
                     }