aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-09-06 12:00:51 -0300
committerJames Almer <jamrial@gmail.com>2021-09-07 09:44:58 -0300
commit5fe648d04a2af3229704b26f114ba87158b9e9d2 (patch)
tree2dc6068c7cea22f15d3649a5a259d9ea69db5ae6 /libswscale
parentc655a734b1f799e4c41349e99b0e85c5b6e1045c (diff)
downloadffmpeg-5fe648d04a2af3229704b26f114ba87158b9e9d2.tar.gz
libswscale/swscale: initialize all dst plane pointers in sws_receive_slice()
Fixes valgrind warnings about use of uninitialised values. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index c233818dcf..b9c9647fcb 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1160,9 +1160,9 @@ int sws_receive_slice(struct SwsContext *c, unsigned int slice_start,
return ret;
}
- for (int i = 0; i < FF_ARRAY_ELEMS(dst) && c->frame_dst->data[i]; i++) {
- dst[i] = c->frame_dst->data[i] +
- c->frame_dst->linesize[i] * (slice_start >> c->chrDstVSubSample);
+ for (int i = 0; i < FF_ARRAY_ELEMS(dst); i++) {
+ ptrdiff_t offset = c->frame_dst->linesize[i] * (slice_start >> c->chrDstVSubSample);
+ dst[i] = FF_PTR_ADD(c->frame_dst->data[i], offset);
}
return scale_internal(c, (const uint8_t * const *)c->frame_src->data,