summaryrefslogtreecommitdiffstats
path: root/libvo/vo_gl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/vo_gl.c')
-rw-r--r--libvo/vo_gl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index 7e559cd256..f40f13e719 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -691,8 +691,11 @@ static uint32_t get_image(mp_image_t *mpi) {
if (!gl_buffer)
GenBuffers(1, &gl_buffer);
BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer);
- if (ati_hack)
- mpi->width = (mpi->width + 255) & ~255;
+ if (ati_hack) {
+ int s = 1;
+ while (s < mpi->width) s *= 2;
+ mpi->width = s;
+ }
mpi->stride[0] = mpi->width * mpi->bpp / 8;
if (mpi->stride[0] * mpi->height > gl_buffersize) {
BufferData(GL_PIXEL_UNPACK_BUFFER, mpi->stride[0] * mpi->height,