Browse Source

Use av_fast_malloc instead of av_realloc.

This should be faster, is less code and fixes issue 2524
(allocation error would lead to crash).
tags/n0.8
Reimar Döffinger 14 years ago
parent
commit
e7b95918fc
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      libavcodec/nuv.c

+ 1
- 2
libavcodec/nuv.c View File

@@ -116,8 +116,7 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, int qualit
return 0;
avctx->width = c->width = width;
avctx->height = c->height = height;
c->decomp_size = c->height * c->width * 3 / 2;
c->decomp_buf = av_realloc(c->decomp_buf, c->decomp_size + AV_LZO_OUTPUT_PADDING);
av_fast_malloc(&c->decomp_buf, &c->decomp_size, c->height * c->width * 3 / 2);
if (!c->decomp_buf) {
av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
return 0;


Loading…
Cancel
Save