comparison src/video/x11/SDL_x11yuv.c @ 434:ed58b98c0d9d

Commented double-free buggy code. Will examine more closely later.
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 12 Aug 2002 14:54:38 +0000
parents c1666427297c
children 95aa4041e7f9
comparison
equal deleted inserted replaced
433:706de3956894 434:ed58b98c0d9d
130 } 130 }
131 } 131 }
132 SDL_NAME(XvFreeAdaptorInfo)(ainfo); 132 SDL_NAME(XvFreeAdaptorInfo)(ainfo);
133 } 133 }
134 134
135 #if 0
135 /* 136 /*
136 * !!! FIXME: 137 * !!! FIXME:
137 * "Here are some diffs for X11 and yuv. Note that the last part 2nd 138 * "Here are some diffs for X11 and yuv. Note that the last part 2nd
138 * diff should probably be a new call to XvQueryAdaptorFree with ainfo 139 * diff should probably be a new call to XvQueryAdaptorFree with ainfo
139 * and the number of adaptors, instead of the loop through like I did." 140 * and the number of adaptors, instead of the loop through like I did."
141 *
142 * ACHTUNG: This is broken! It looks like XvFreeAdaptorInfo does this
143 * for you, so we end up with a double-free. I need to look at this
144 * more closely... --ryan.
140 */ 145 */
141 for ( i=0; i < adaptors; ++i ) { 146 for ( i=0; i < adaptors; ++i ) {
142 if (ainfo[i].name != NULL) Xfree(ainfo[i].name); 147 if (ainfo[i].name != NULL) Xfree(ainfo[i].name);
143 if (ainfo[i].formats != NULL) Xfree(ainfo[i].formats); 148 if (ainfo[i].formats != NULL) Xfree(ainfo[i].formats);
144 } 149 }
145 Xfree(ainfo); 150 Xfree(ainfo);
151 #endif
146 152
147 if ( xv_port == -1 ) { 153 if ( xv_port == -1 ) {
148 SDL_SetError("No available video ports for requested format"); 154 SDL_SetError("No available video ports for requested format");
149 return(NULL); 155 return(NULL);
150 } 156 }