mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-15 19:40:07 +01:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user