diff options
author | James Almer <jamrial@gmail.com> | 2021-09-06 12:00:51 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-09-07 09:44:58 -0300 |
commit | 5fe648d04a2af3229704b26f114ba87158b9e9d2 (patch) | |
tree | 2dc6068c7cea22f15d3649a5a259d9ea69db5ae6 /libswscale | |
parent | c655a734b1f799e4c41349e99b0e85c5b6e1045c (diff) | |
download | ffmpeg-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.c | 6 |
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, |