comparison libvo/vo_gl2.c @ 32537:8fa2f43cb760

Remove most of the NULL pointer check before free all over the code
author cboesch
date Sun, 14 Nov 2010 09:12:34 +0000
parents fbe5c829c69b
children 899d817e56fc
comparison
equal deleted inserted replaced
32536:187f26cba0ce 32537:8fa2f43cb760
234 /* Allocate the texture memory */ 234 /* Allocate the texture memory */
235 235
236 texpercx = (GLfloat) texture_width / (GLfloat) image_width; 236 texpercx = (GLfloat) texture_width / (GLfloat) image_width;
237 texpercy = (GLfloat) texture_height / (GLfloat) image_height; 237 texpercy = (GLfloat) texture_height / (GLfloat) image_height;
238 238
239 if (texgrid) 239 free(texgrid);
240 free(texgrid);
241 texgrid = calloc (texnumx * texnumy, sizeof (struct TexSquare)); 240 texgrid = calloc (texnumx * texnumy, sizeof (struct TexSquare));
242 241
243 raw_line_len = image_width * image_bytes; 242 raw_line_len = image_width * image_bytes;
244 243
245 mp_msg (MSGT_VO, MSGL_DBG2, "[gl2] texture-usage %d*width=%d, %d*height=%d\n", 244 mp_msg (MSGT_VO, MSGL_DBG2, "[gl2] texture-usage %d*width=%d, %d*height=%d\n",
826 825
827 static void 826 static void
828 uninit(void) 827 uninit(void)
829 { 828 {
830 if ( !vo_config_count ) return; 829 if ( !vo_config_count ) return;
831 if (texgrid) { 830 free(texgrid);
832 free(texgrid); 831 texgrid = NULL;
833 texgrid = NULL;
834 }
835 uninit_mpglcontext(&glctx); 832 uninit_mpglcontext(&glctx);
836 } 833 }
837 834
838 static const opt_t subopts[] = { 835 static const opt_t subopts[] = {
839 {"yuv", OPT_ARG_INT, &use_yuv, int_non_neg}, 836 {"yuv", OPT_ARG_INT, &use_yuv, int_non_neg},