From: Francois Cartegnie Date: Wed, 29 Aug 2018 09:07:38 +0000 (+0200) Subject: vout: opengl: converter: prevent FPE with cropped empty spu X-Git-Tag: archive/raspbian/3.0.11.1-2+rpi1~1^2^2^2^2^2^2^2^2^2^2^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d418e10ab6c3880ac28c5465ce6f31b04db44565;p=vlc.git vout: opengl: converter: prevent FPE with cropped empty spu Gbp-Pq: Name 0005-vout-opengl-converter-prevent-FPE-with-cropped-empty.patch --- diff --git a/modules/video_output/opengl/converter_sw.c b/modules/video_output/opengl/converter_sw.c index e48b8005..4e510bcd 100644 --- a/modules/video_output/opengl/converter_sw.c +++ b/modules/video_output/opengl/converter_sw.c @@ -234,7 +234,7 @@ tc_pbo_update(const opengl_tex_converter_t *tc, GLuint *textures, tc->vt->BindTexture(tc->tex_target, textures[i]); tc->vt->PixelStorei(GL_UNPACK_ROW_LENGTH, pic->p[i].i_pitch - * tex_width[i] / pic->p[i].i_visible_pitch); + * tex_width[i] / (pic->p[i].i_visible_pitch ?: 1)); tc->vt->TexSubImage2D(tc->tex_target, 0, 0, 0, tex_width[i], tex_height[i], tc->texs[i].format, tc->texs[i].type, NULL); @@ -493,7 +493,7 @@ upload_plane(const opengl_tex_converter_t *tc, unsigned tex_idx, } else { - tc->vt->PixelStorei(GL_UNPACK_ROW_LENGTH, pitch * width / visible_pitch); + tc->vt->PixelStorei(GL_UNPACK_ROW_LENGTH, pitch * width / (visible_pitch ?: 1)); tc->vt->TexSubImage2D(tc->tex_target, 0, 0, 0, width, height, tex_format, tex_type, pixels); }