Revision: 45863
http://brlcad.svn.sourceforge.net/brlcad/?rev=45863&view=rev
Author: brlcad
Date: 2011-08-09 23:04:15 +0000 (Tue, 09 Aug 2011)
Log Message:
-----------
prevent crashing if the dsp buffer isn't set yet
Modified Paths:
--------------
brlcad/trunk/src/librt/primitives/dsp/dsp.h
Modified: brlcad/trunk/src/librt/primitives/dsp/dsp.h
===================================================================
--- brlcad/trunk/src/librt/primitives/dsp/dsp.h 2011-08-09 22:36:06 UTC (rev
45862)
+++ brlcad/trunk/src/librt/primitives/dsp/dsp.h 2011-08-09 23:04:15 UTC (rev
45863)
@@ -23,12 +23,11 @@
*/
/* access to the DSP data array */
-# define DSP(_p, _x, _y) ( \
- ( \
- (unsigned short *) \
- ((_p)->dsp_buf) \
- )[ \
- (_y) * ((struct rt_dsp_internal *)_p)->dsp_xcnt + (_x) ] )
+# define DSP(_p, _x, _y) ( \
+ ((_p) && (_p)->dsp_buf) ? \
+ ((unsigned short *)((_p)->dsp_buf))[ \
+ (_y) * ((struct rt_dsp_internal *)_p)->dsp_xcnt + (_x) \
+ ] : 0)
/*
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits