Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2019-12-28 17:05:43 +0300
committerMarton Balint <cus@passwd.hu>2020-01-29 21:53:43 +0300
commit47d5d0cc74d047ce49c0d89878dadb09e8fb8b9c (patch)
tree95251777a25d56164113bb698286d1fba5e1dc8c /libavfilter/vf_geq.c
parent04e524c34b4ad6b202f291f278d9f659806e6188 (diff)
avfilter/vf_geq: fix multiple assignments of ptr in slice_geq_filter
Fixes Coverity CID 1427183. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavfilter/vf_geq.c')
-rw-r--r--libavfilter/vf_geq.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c
index 2905efae24..23c989b248 100644
--- a/libavfilter/vf_geq.c
+++ b/libavfilter/vf_geq.c
@@ -375,8 +375,6 @@ static int slice_geq_filter(AVFilterContext *ctx, void *arg, int jobnr, int nb_j
const int slice_start = (height * jobnr) / nb_jobs;
const int slice_end = (height * (jobnr+1)) / nb_jobs;
int x, y;
- uint8_t *ptr;
- uint16_t *ptr16;
double values[VAR_VARS_NB];
values[VAR_W] = geq->values[VAR_W];
@@ -387,8 +385,8 @@ static int slice_geq_filter(AVFilterContext *ctx, void *arg, int jobnr, int nb_j
values[VAR_T] = geq->values[VAR_T];
if (geq->bps == 8) {
+ uint8_t *ptr = geq->dst + linesize * slice_start;
for (y = slice_start; y < slice_end; y++) {
- ptr = geq->dst + linesize * y;
values[VAR_Y] = y;
for (x = 0; x < width; x++) {
@@ -397,15 +395,15 @@ static int slice_geq_filter(AVFilterContext *ctx, void *arg, int jobnr, int nb_j
}
ptr += linesize;
}
- }
- else {
+ } else {
+ uint16_t *ptr16 = geq->dst16 + (linesize/2) * slice_start;
for (y = slice_start; y < slice_end; y++) {
- ptr16 = geq->dst16 + (linesize/2) * y;
values[VAR_Y] = y;
for (x = 0; x < width; x++) {
values[VAR_X] = x;
ptr16[x] = av_expr_eval(geq->e[plane], values, geq);
}
+ ptr16 += linesize/2;
}
}