dri2: Fix NULL check in allocation error handling
1461b31e40
tests to see if the allocation
of buffer[i] failed after i has been incremented, causing it to look
at the wrong pointer.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
27cec0a050
commit
cba9942f77
|
@ -421,22 +421,24 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
|
||||||
if (need_real_front > 0) {
|
if (need_real_front > 0) {
|
||||||
if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFrontLeft,
|
if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFrontLeft,
|
||||||
front_format, dimensions_match,
|
front_format, dimensions_match,
|
||||||
&buffers[i++]))
|
&buffers[i]))
|
||||||
buffers_changed = 1;
|
buffers_changed = 1;
|
||||||
|
|
||||||
if (buffers[i] == NULL)
|
if (buffers[i] == NULL)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_fake_front > 0) {
|
if (need_fake_front > 0) {
|
||||||
if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFakeFrontLeft,
|
if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFakeFrontLeft,
|
||||||
front_format, dimensions_match,
|
front_format, dimensions_match,
|
||||||
&buffers[i++]))
|
&buffers[i]))
|
||||||
buffers_changed = 1;
|
buffers_changed = 1;
|
||||||
|
|
||||||
if (buffers[i] == NULL)
|
if (buffers[i] == NULL)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
|
||||||
|
i++;
|
||||||
have_fake_front = 1;
|
have_fake_front = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user