changeset 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 e10acab2322a
children 0e381e54eeb0
files flashsv.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flashsv.c	Sun Jan 21 12:32:01 2007 +0000
+++ b/flashsv.c	Sun Jan 21 14:14:50 2007 +0000
@@ -135,12 +135,12 @@
     if(s->block_size < s->block_width*s->block_height) {
         if (s->tmpblock != NULL)
             av_free(s->tmpblock);
-        s->block_size = s->block_width*s->block_height;
-        if ((s->tmpblock = av_malloc(3*s->block_size)) == NULL) {
+        if ((s->tmpblock = av_malloc(3*s->block_width*s->block_height)) == NULL) {
             av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
             return -1;
         }
     }
+    s->block_size = s->block_width*s->block_height;
 
     /* init the image size once */
     if((avctx->width==0) && (avctx->height==0)){