[vlc-commits] win32/common: make sure the values we're using are valid
Steve Lhomme
git at videolan.org
Fri Jul 29 00:35:47 CEST 2016
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Jul 28 15:27:00 2016 +0200| [8d6fb616004569087ff75393ae3daa5168ec2192] | committer: Jean-Baptiste Kempf
win32/common: make sure the values we're using are valid
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8d6fb616004569087ff75393ae3daa5168ec2192
---
modules/video_output/win32/common.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index c3029a5..c15a8f9 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -452,6 +452,8 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
picture->p->p_pixels = data;
picture->p->i_pitch = pitch;
picture->p->i_lines = picture->format.i_height;
+ assert(picture->p->i_visible_pitch <= picture->p->i_pitch);
+ assert(picture->p->i_visible_lines <= picture->p->i_lines);
/* Fill chroma planes for biplanar YUV */
if (picture->format.i_chroma == VLC_CODEC_NV12 ||
@@ -464,6 +466,8 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
p->i_pitch = pitch;
p->i_lines = picture->format.i_height;
+ assert(p->i_visible_pitch <= p->i_pitch);
+ assert(p->i_visible_lines <= p->i_lines);
}
/* The dx/d3d buffer is always allocated as NV12 */
if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, VLC_CODEC_NV12)) {
More information about the vlc-commits
mailing list