[vlc-commits] swscale: fix memory corruption when i_extend_factor != 1
vlc/vlc-2.2 | branch: master | Thomas Guillem | Tue Dec 16 12:02:27 2014 +| [52a0b27e320f2dea61a97d052d9ead435db59436] | committer: David Fuhrmann swscale: fix memory corruption when i_extend_factor != 1 This led to a random crash when resizing video on a small display (or when resizing small video). close #14005 Signed-off-by: Jean-Baptiste Kempf (cherry picked from commit 868f5b89056218030b690621e89ca97b46635f6c) Signed-off-by: David Fuhrmann > http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=52a0b27e320f2dea61a97d052d9ead435db59436 --- modules/video_chroma/swscale.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/video_chroma/swscale.c b/modules/video_chroma/swscale.c index f7f8082..569e0f5 100644 --- a/modules/video_chroma/swscale.c +++ b/modules/video_chroma/swscale.c @@ -575,7 +575,7 @@ static void CopyPad( picture_t *p_dst, const picture_t *p_src ) const plane_t *s = &p_src->p[n]; plane_t *d = &p_dst->p[n]; -for( int y = 0; y < s->i_lines; y++ ) +for( int y = 0; y < s->i_lines && y < d->i_lines; y++ ) { for( int x = s->i_visible_pitch; x < d->i_visible_pitch; x += s->i_pixel_pitch ) memcpy( &d->p_pixels[y*d->i_pitch + x], &d->p_pixels[y*d->i_pitch + s->i_visible_pitch - s->i_pixel_pitch], s->i_pixel_pitch ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] swscale: fix memory corruption when i_extend_factor != 1
vlc | branch: master | Thomas Guillem | Tue Dec 16 12:02:27 2014 +| [868f5b89056218030b690621e89ca97b46635f6c] | committer: Jean-Baptiste Kempf swscale: fix memory corruption when i_extend_factor != 1 This led to a random crash when resizing video on a small display (or when resizing small video). Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=868f5b89056218030b690621e89ca97b46635f6c --- modules/video_chroma/swscale.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/video_chroma/swscale.c b/modules/video_chroma/swscale.c index c53cce5..c99e569 100644 --- a/modules/video_chroma/swscale.c +++ b/modules/video_chroma/swscale.c @@ -561,7 +561,7 @@ static void CopyPad( picture_t *p_dst, const picture_t *p_src ) const plane_t *s = &p_src->p[n]; plane_t *d = &p_dst->p[n]; -for( int y = 0; y < s->i_lines; y++ ) +for( int y = 0; y < s->i_lines && y < d->i_lines; y++ ) { for( int x = s->i_visible_pitch; x < d->i_visible_pitch; x += s->i_pixel_pitch ) memcpy( &d->p_pixels[y*d->i_pitch + x], &d->p_pixels[y*d->i_pitch + s->i_visible_pitch - s->i_pixel_pitch], s->i_pixel_pitch ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits