diff options
| author | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-10-31 17:25:20 +0000 |
|---|---|---|
| committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-10-31 17:25:20 +0000 |
| commit | 68fb5107a56d7efcf82a7c8015fbc0f39434f056 (patch) | |
| tree | a922d23615b9624900107d5943b0b123b073553d /src/video_out/video_out_stk.c | |
| parent | 1fbd6d1d81d24259a20ce2bcd77687bd69e8e7fd (diff) | |
| download | xine-lib-68fb5107a56d7efcf82a7c8015fbc0f39434f056.tar.gz xine-lib-68fb5107a56d7efcf82a7c8015fbc0f39434f056.tar.bz2 | |
First check the pointers on NULL values, then memset;
patch provided by Chris Rankin
CVS patchset: 5650
CVS date: 2003/10/31 17:25:20
Diffstat (limited to 'src/video_out/video_out_stk.c')
| -rw-r--r-- | src/video_out/video_out_stk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/video_out/video_out_stk.c b/src/video_out/video_out_stk.c index 871214b34..a24c087ef 100644 --- a/src/video_out/video_out_stk.c +++ b/src/video_out/video_out_stk.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_stk.c,v 1.7 2003/10/23 15:17:07 mroi Exp $ + * $Id: video_out_stk.c,v 1.8 2003/10/31 17:25:20 mroi Exp $ * * video_out_stk.c, Libstk Surface Video Driver * more info on Libstk at http://www.libstk.org @@ -129,10 +129,11 @@ static vo_frame_t *stk_alloc_frame(vo_driver_t *this_gen) { stk_frame_t* frame; //printf("video_out_stk: alloc_frame()\n"); frame = (stk_frame_t *)malloc(sizeof(stk_frame_t)); - memset(frame, 0, sizeof(stk_frame_t)); if (frame == NULL) { printf("stk_alloc_frame: out of memory\n"); + return NULL; } + memset(frame, 0, sizeof(stk_frame_t)); /* populate the frame members*/ pthread_mutex_init (&frame->vo_frame.mutex, NULL); |
