Browse Source

avcodec/j2kenc: Only allocate cblk.data once

Fixes: memleak
Found-by: <jamrial>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.0
Michael Niedermayer 8 years ago
parent
commit
7c191dfba7
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/j2kenc.c

+ 2
- 1
libavcodec/j2kenc.c View File

@@ -938,7 +938,8 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
}
}
}
prec->cblk[cblkno].data = av_malloc(1 + 8192);
if (!prec->cblk[cblkno].data)
prec->cblk[cblkno].data = av_malloc(1 + 8192);
if (!prec->cblk[cblkno].data)
return AVERROR(ENOMEM);
encode_cblk(s, &t1, prec->cblk + cblkno, tile, xx1 - xx0, yy1 - yy0,


Loading…
Cancel
Save