--- trunk/xvidcore/src/quant/adapt_quant.c 2002/09/20 19:58:36 495 +++ trunk/xvidcore/src/quant/adapt_quant.c 2002/09/21 03:11:36 499 @@ -3,7 +3,7 @@ * XVID MPEG-4 VIDEO CODEC * - Adaptive quantization functions - * - * Copyright(C) 2002 Peter Ross + * Copyright(C) 2002 Peter Ross * * This program is an implementation of a part of one or more MPEG-4 * Video tools as specified in ISO/IEC 14496-2 standard. Those intending @@ -28,7 +28,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: adapt_quant.c,v 1.8 2002-09-20 19:58:36 edgomez Exp $ + * $Id: adapt_quant.c,v 1.10 2002-09-21 03:07:56 suxen_drol Exp $ * ****************************************************************************/ @@ -125,8 +125,10 @@ if (!(quant = (float *) malloc(mb_width * mb_height * sizeof(float)))) return(-1); - if(!(val = (float *) malloc(mb_width * mb_height * sizeof(float)))) + if(!(val = (float *) malloc(mb_width * mb_height * sizeof(float)))) { + free(quant); return(-1); + } for (k = 0; k < mb_height; k++) { for (l = 0; l < mb_width; l++) // do this for all macroblocks individually