[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55351] trunk/blender/source/blender: fix for missing NULL pointer checks and incorrect array free
Campbell Barton
ideasman42 at gmail.com
Sun Mar 17 11:15:06 CET 2013
Revision: 55351
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55351
Author: campbellbarton
Date: 2013-03-17 10:15:06 +0000 (Sun, 17 Mar 2013)
Log Message:
-----------
fix for missing NULL pointer checks and incorrect array free
Modified Paths:
--------------
trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c
trunk/blender/source/blender/imbuf/intern/dds/FlipDXT.cpp
trunk/blender/source/blender/makesrna/intern/rna_object_force.c
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c 2013-03-17 05:53:51 UTC (rev 55350)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c 2013-03-17 10:15:06 UTC (rev 55351)
@@ -704,7 +704,7 @@
ImagePaintState *s = ps;
BrushPainter *painter = s->painter;
ImBuf *ibuf = BKE_image_acquire_ibuf(s->image, s->sima ? &s->sima->iuser : NULL, NULL);
- int is_data = ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA;
+ const bool is_data = (ibuf && ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA);
if (!ibuf)
return 0;
@@ -739,7 +739,7 @@
brush_painter_2d_require_imbuf(painter, ((ibuf->rect_float) ? 1 : 0), 0, 0);
if (painter->cache.enabled)
- brush_painter_2d_refresh_cache(painter, newuv, is_data == FALSE);
+ brush_painter_2d_refresh_cache(painter, newuv, is_data == false);
if (paint_2d_op(s, painter->cache.ibuf, olduv, newuv)) {
imapaint_image_update(s->sima, s->image, ibuf, false);
Modified: trunk/blender/source/blender/imbuf/intern/dds/FlipDXT.cpp
===================================================================
--- trunk/blender/source/blender/imbuf/intern/dds/FlipDXT.cpp 2013-03-17 05:53:51 UTC (rev 55350)
+++ trunk/blender/source/blender/imbuf/intern/dds/FlipDXT.cpp 2013-03-17 10:15:06 UTC (rev 55351)
@@ -241,7 +241,7 @@
memcpy(line2, temp_line, row_bytes);
}
- delete temp_line;
+ delete[] temp_line;
}
// mip levels are contiguous.
Modified: trunk/blender/source/blender/makesrna/intern/rna_object_force.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object_force.c 2013-03-17 05:53:51 UTC (rev 55350)
+++ trunk/blender/source/blender/makesrna/intern/rna_object_force.c 2013-03-17 10:15:06 UTC (rev 55351)
@@ -483,7 +483,7 @@
part->pd->tex = NULL;
}
- if (part->pd2->forcefield != PFIELD_TEXTURE && part->pd2->tex) {
+ if (part->pd2 && part->pd2->forcefield != PFIELD_TEXTURE && part->pd2->tex) {
part->pd2->tex->id.us--;
part->pd2->tex = NULL;
}
More information about the Bf-blender-cvs
mailing list