@@ -87,7 +87,7 @@ JNIEXPORT void JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniCropBi
87
87
uint32_t right, uint32_t bottom)
88
88
{
89
89
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
90
- if (jniBitmap->_storedBitmapPixels == NULL )
90
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
91
91
return ;
92
92
uint32_t * previousData = jniBitmap->_storedBitmapPixels ;
93
93
uint32_t oldWidth = jniBitmap->_bitmapInfo .width ;
@@ -113,7 +113,7 @@ JNIEXPORT void JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniRotate
113
113
JNIEnv * env, jobject obj, jobject handle)
114
114
{
115
115
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
116
- if (jniBitmap->_storedBitmapPixels == NULL )
116
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
117
117
return ;
118
118
uint32_t * previousData = jniBitmap->_storedBitmapPixels ;
119
119
uint32_t newWidth = jniBitmap->_bitmapInfo .height ;
@@ -141,7 +141,7 @@ JNIEXPORT void JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniRotate
141
141
JNIEnv * env, jobject obj, jobject handle)
142
142
{
143
143
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
144
- if (jniBitmap->_storedBitmapPixels == NULL )
144
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
145
145
return ;
146
146
uint32_t * previousData = jniBitmap->_storedBitmapPixels ;
147
147
uint32_t newWidth = jniBitmap->_bitmapInfo .height ;
@@ -169,7 +169,7 @@ JNIEXPORT void JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniRotate
169
169
JNIEnv * env, jobject obj, jobject handle)
170
170
{
171
171
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
172
- if (jniBitmap->_storedBitmapPixels == NULL )
172
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
173
173
return ;
174
174
uint32_t * pixels = jniBitmap->_storedBitmapPixels ;
175
175
uint32_t * pixels2 = jniBitmap->_storedBitmapPixels ;
@@ -211,7 +211,7 @@ JNIEXPORT void JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniFreeBi
211
211
JNIEnv * env, jobject obj, jobject handle)
212
212
{
213
213
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
214
- if (jniBitmap->_storedBitmapPixels == NULL )
214
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
215
215
return ;
216
216
delete[] jniBitmap->_storedBitmapPixels ;
217
217
jniBitmap->_storedBitmapPixels = NULL ;
@@ -223,7 +223,7 @@ JNIEXPORT jobject JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniGet
223
223
JNIEnv * env, jobject obj, jobject handle)
224
224
{
225
225
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
226
- if (jniBitmap->_storedBitmapPixels == NULL )
226
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
227
227
{
228
228
LOGD (" no bitmap data was stored. returning null..." );
229
229
return NULL ;
@@ -311,7 +311,7 @@ JNIEXPORT void JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniScaleN
311
311
uint32_t newHeight)
312
312
{
313
313
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
314
- if (jniBitmap->_storedBitmapPixels == NULL )
314
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
315
315
return ;
316
316
uint32_t oldWidth = jniBitmap->_bitmapInfo .width ;
317
317
uint32_t oldHeight = jniBitmap->_bitmapInfo .height ;
@@ -353,7 +353,7 @@ JNIEXPORT void JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniScaleB
353
353
{
354
354
355
355
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
356
- if (jniBitmap->_storedBitmapPixels == NULL )
356
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
357
357
return ;
358
358
uint32_t oldWidth = jniBitmap->_bitmapInfo .width ;
359
359
uint32_t oldHeight = jniBitmap->_bitmapInfo .height ;
@@ -486,7 +486,7 @@ JNIEXPORT void JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniFlipBi
486
486
JNIEnv * env, jobject obj, jobject handle)
487
487
{
488
488
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
489
- if (jniBitmap->_storedBitmapPixels == NULL )
489
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
490
490
return ;
491
491
uint32_t * previousData = jniBitmap->_storedBitmapPixels ;
492
492
int width = jniBitmap->_bitmapInfo .width , middle = width / 2 , height =
@@ -518,7 +518,7 @@ JNIEXPORT void JNICALL Java_com_jni_bitmap_1operations_JniBitmapHolder_jniFlipBi
518
518
JNIEnv * env, jobject obj, jobject handle)
519
519
{
520
520
JniBitmap* jniBitmap = (JniBitmap*) env->GetDirectBufferAddress (handle);
521
- if (jniBitmap->_storedBitmapPixels == NULL )
521
+ if (jniBitmap == NULL || jniBitmap ->_storedBitmapPixels == NULL )
522
522
return ;
523
523
uint32_t * previousData = jniBitmap->_storedBitmapPixels ;
524
524
int width = jniBitmap->_bitmapInfo .width , height =
0 commit comments