]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
The block_size might be used incorrectly if it is not updated.
authorbanan <banan@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 21 Jan 2007 14:14:50 +0000 (14:14 +0000)
committerbanan <banan@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 21 Jan 2007 14:14:50 +0000 (14:14 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7607 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/flashsv.c

index 4f99856006b3a94aa3ea1a3b0b1569327e363321..b5905e1ea42830c937c52990dad408aafd796a3d 100644 (file)
@@ -135,12 +135,12 @@ static int flashsv_decode_frame(AVCodecContext *avctx,
     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)){