Merge pull request #767 from julienmalik/fix_memset_null_pointer
Fix UBSan gcc warning for first arg to memset non null
This commit is contained in:
@@ -1180,8 +1180,11 @@ static OPJ_BOOL opj_t1_allocate_buffers(
|
|||||||
}
|
}
|
||||||
t1->datasize=datasize;
|
t1->datasize=datasize;
|
||||||
}
|
}
|
||||||
|
/* memset first arg is declared to never be null by gcc */
|
||||||
|
if (t1->data != NULL) {
|
||||||
memset(t1->data,0,datasize * sizeof(OPJ_INT32));
|
memset(t1->data,0,datasize * sizeof(OPJ_INT32));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
t1->flags_stride=w+2;
|
t1->flags_stride=w+2;
|
||||||
flagssize=t1->flags_stride * (h+2);
|
flagssize=t1->flags_stride * (h+2);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user