The third argument is supposed to be the size of the file in memory. sizeof(texture) gives you the size of the texture pointer (probably 4 or 8 bytes).
Note that the type is important when using sizeof. If texture is an array it will return the size of the array. If texture is a pointer it will return the size of the pointer.
1 2 3 4 5 6 7 8 9 10 11 12
void SomeOtherFunction()
{
BYTE texture[1000];
// texture is an array here.
// sizeof(texture) will return 1000.
}
void AddTexture(BYTE* texture)
{
// texture is a pointer here.
// sizeof(texture) will return the size of the pointer (usually 4 or 8).
}