diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-09 20:31:29 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-09 20:31:29 +0100 |
commit | 8c677a9f06c5d145da0301cdc3c6bff9ebacb5d7 (patch) | |
tree | 9c756ade47cc06771cb120f53b5f9c22724717f6 /libavcodec/libvpxenc.c | |
parent | 94a849b8b6c3e4a90361485b2e12a9a5c35833a3 (diff) | |
parent | 9b8d11a76ae7bca8bbb58abb822138f8b42c776c (diff) | |
download | ffmpeg-8c677a9f06c5d145da0301cdc3c6bff9ebacb5d7.tar.gz |
Merge commit '9b8d11a76ae7bca8bbb58abb822138f8b42c776c'
* commit '9b8d11a76ae7bca8bbb58abb822138f8b42c776c':
avcodec: Use av_reallocp where suitable
Conflicts:
libavcodec/bitstream.c
libavcodec/eatgv.c
libavcodec/flashsv.c
libavcodec/libtheoraenc.c
libavcodec/libvpxenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libvpxenc.c')
-rw-r--r-- | libavcodec/libvpxenc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 8883801e1b..c7ca050b17 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -638,11 +638,13 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out, break; case VPX_CODEC_STATS_PKT: { struct vpx_fixed_buf *stats = &ctx->twopass_stats; - stats->buf = av_realloc_f(stats->buf, 1, - stats->sz + pkt->data.twopass_stats.sz); - if (!stats->buf) { + int err; + if ((err = av_reallocp(&stats->buf, + stats->sz + + pkt->data.twopass_stats.sz)) < 0) { + stats->sz = 0; av_log(avctx, AV_LOG_ERROR, "Stat buffer realloc failed\n"); - return AVERROR(ENOMEM); + return err; } memcpy((uint8_t*)stats->buf + stats->sz, pkt->data.twopass_stats.buf, pkt->data.twopass_stats.sz); |