diff options
author | Nayan Deshmukh <nayan26deshmukh@gmail.com> | 2017-02-22 13:55:02 +0530 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2017-02-22 21:49:19 +0100 |
commit | b8861911c5c1556d27d5e9bcabfd667c894222d8 (patch) | |
tree | c4adbca7e81b53fae5f1cf33c82f9a8ade2016ac /src/gallium | |
parent | 7ce8adad43eb556f4951b63ee4773864ff1a5f17 (diff) |
vl: u_upload_alloc might fail to allocate buffer in bicubic filter
Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_bicubic_filter.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/vl/vl_bicubic_filter.c b/src/gallium/auxiliary/vl/vl_bicubic_filter.c index ae29208428..efd8a1c7ae 100644 --- a/src/gallium/auxiliary/vl/vl_bicubic_filter.c +++ b/src/gallium/auxiliary/vl/vl_bicubic_filter.c @@ -421,14 +421,16 @@ vl_bicubic_filter_render(struct vl_bicubic_filter *filter, viewport.scale[2] = 1; struct pipe_constant_buffer cb = {}; - float *ptr; + float *ptr = NULL; u_upload_alloc(filter->pipe->const_uploader, 0, 2 * sizeof(float), 256, &cb.buffer_offset, &cb.buffer, (void**)&ptr); cb.buffer_size = 2 * sizeof(float); - ptr[0] = 0.5f/viewport.scale[0]; - ptr[1] = 0.5f/viewport.scale[1]; + if (ptr) { + ptr[0] = 0.5f/viewport.scale[0]; + ptr[1] = 0.5f/viewport.scale[1]; + } u_upload_unmap(filter->pipe->const_uploader); memset(&fb_state, 0, sizeof(fb_state)); |