comparison flashsv.c @ 4370:e6eb67453d94 libavcodec

The block_size might be used incorrectly if it is not updated.
author banan
date Sun, 21 Jan 2007 14:14:50 +0000
parents b885917fbfef
children 0e381e54eeb0
comparison
equal deleted inserted replaced
4369:e10acab2322a 4370:e6eb67453d94
133 /* the block size could change between frames, make sure the buffer 133 /* the block size could change between frames, make sure the buffer
134 * is large enough, if not, get a larger one */ 134 * is large enough, if not, get a larger one */
135 if(s->block_size < s->block_width*s->block_height) { 135 if(s->block_size < s->block_width*s->block_height) {
136 if (s->tmpblock != NULL) 136 if (s->tmpblock != NULL)
137 av_free(s->tmpblock); 137 av_free(s->tmpblock);
138 s->block_size = s->block_width*s->block_height; 138 if ((s->tmpblock = av_malloc(3*s->block_width*s->block_height)) == NULL) {
139 if ((s->tmpblock = av_malloc(3*s->block_size)) == NULL) {
140 av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n"); 139 av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
141 return -1; 140 return -1;
142 } 141 }
143 } 142 }
143 s->block_size = s->block_width*s->block_height;
144 144
145 /* init the image size once */ 145 /* init the image size once */
146 if((avctx->width==0) && (avctx->height==0)){ 146 if((avctx->width==0) && (avctx->height==0)){
147 avctx->width = s->image_width; 147 avctx->width = s->image_width;
148 avctx->height = s->image_height; 148 avctx->height = s->image_height;