i965: check pointer before dereferencing it
Check that irb isn't NULL before accessing irb->Base.Base.NumSamples. CID: 1026046 Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
This commit is contained in:
@@ -52,6 +52,13 @@ intel_copy_texsubimage(struct brw_context *brw,
|
|||||||
{
|
{
|
||||||
const GLenum internalFormat = intelImage->base.Base.InternalFormat;
|
const GLenum internalFormat = intelImage->base.Base.InternalFormat;
|
||||||
|
|
||||||
|
if (!intelImage->mt || !irb || !irb->mt) {
|
||||||
|
if (unlikely(INTEL_DEBUG & DEBUG_PERF))
|
||||||
|
fprintf(stderr, "%s fail %p %p (0x%08x)\n",
|
||||||
|
__func__, intelImage->mt, irb, internalFormat);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* No pixel transfer operations (zoom, bias, mapping), just a blit */
|
/* No pixel transfer operations (zoom, bias, mapping), just a blit */
|
||||||
if (brw->ctx._ImageTransferState)
|
if (brw->ctx._ImageTransferState)
|
||||||
return false;
|
return false;
|
||||||
@@ -69,13 +76,6 @@ intel_copy_texsubimage(struct brw_context *brw,
|
|||||||
/* glCopyTexSubImage() can't be called on a multisampled texture. */
|
/* glCopyTexSubImage() can't be called on a multisampled texture. */
|
||||||
assert(intelImage->base.Base.NumSamples == 0);
|
assert(intelImage->base.Base.NumSamples == 0);
|
||||||
|
|
||||||
if (!intelImage->mt || !irb || !irb->mt) {
|
|
||||||
if (unlikely(INTEL_DEBUG & DEBUG_PERF))
|
|
||||||
fprintf(stderr, "%s fail %p %p (0x%08x)\n",
|
|
||||||
__func__, intelImage->mt, irb, internalFormat);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* account for view parameters and face index */
|
/* account for view parameters and face index */
|
||||||
int dst_level = intelImage->base.Base.Level +
|
int dst_level = intelImage->base.Base.Level +
|
||||||
intelImage->base.Base.TexObject->MinLevel;
|
intelImage->base.Base.TexObject->MinLevel;
|
||||||
|
Reference in New Issue
Block a user