comparison mimic.c @ 9415:141badec76fc libavcodec

Add a av_fast_malloc function and replace several uses of av_fast_realloc, thus avoiding potential memleaks and pointless memcpys.
author reimar
date Sun, 12 Apr 2009 13:17:37 +0000
parents 5a738e8f9524
children 0dce4fe6e6f3
comparison
equal deleted inserted replaced
9414:5a738e8f9524 9415:141badec76fc
332 } 332 }
333 333
334 prepare_avpic(ctx, &ctx->flipped_ptrs[ctx->cur_index], 334 prepare_avpic(ctx, &ctx->flipped_ptrs[ctx->cur_index],
335 (AVPicture*) &ctx->buf_ptrs[ctx->cur_index]); 335 (AVPicture*) &ctx->buf_ptrs[ctx->cur_index]);
336 336
337 ctx->swap_buf = av_fast_realloc(ctx->swap_buf, &ctx->swap_buf_size, 337 av_fast_malloc(&ctx->swap_buf, &ctx->swap_buf_size,
338 swap_buf_size + FF_INPUT_BUFFER_PADDING_SIZE); 338 swap_buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
339 if(!ctx->swap_buf) 339 if(!ctx->swap_buf)
340 return AVERROR(ENOMEM); 340 return AVERROR(ENOMEM);
341 341
342 ctx->dsp.bswap_buf(ctx->swap_buf, 342 ctx->dsp.bswap_buf(ctx->swap_buf,