check_map_teximage(texImage, slice, x, y, w, h);
+ if (!swImage->Buffer) {
+ /* Either glTexImage was called with a NULL <pixels> argument or
+ * we ran out of memory when allocating texture memory,
+ */
+ *mapOut = NULL;
+ *rowStrideOut = 0;
+ return;
+ }
+
texelSize = _mesa_get_format_bytes(texImage->TexFormat);
stride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width);
_mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
assert(x % bw == 0);
assert(y % bh == 0);
- if (!swImage->Buffer) {
- /* probably ran out of memory when allocating tex mem */
- *mapOut = NULL;
- return;
- }
-
/* This function can only be used with a swrast-allocated buffer, in which
* case ImageSlices is populated with pointers into Buffer.
*/