[FFmpeg-cvslog] libswscale/swscale: initialize all dst plane pointers in sws_receive_slice()
James Almer
git at videolan.org
Tue Sep 7 15:45:30 EEST 2021
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Sep 6 12:00:51 2021 -0300| [5fe648d04a2af3229704b26f114ba87158b9e9d2] | committer: James Almer
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 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5fe648d04a2af3229704b26f114ba87158b9e9d2
---
libswscale/swscale.c | 6 +++---
1 file 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,
More information about the ffmpeg-cvslog
mailing list