diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-12-10 02:41:44 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-11 16:24:16 +0100 |
commit | a6d292b954cb45b512251b31efbe58e44dcf159c (patch) | |
tree | c3d68f29a2bece7ec4fa8b2606631f86f219af8f | |
parent | 91f775e0c533374f1c94e1a094d19d269b70e1e7 (diff) | |
download | ffmpeg-a6d292b954cb45b512251b31efbe58e44dcf159c.tar.gz |
avformat/flvenc: Don't reimplement ff_alloc_extradata
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/flvenc.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 872050a74f..862082dd2d 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -908,14 +908,10 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) int side_size = 0; uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) { - av_free(par->extradata); - par->extradata = av_mallocz(side_size + AV_INPUT_BUFFER_PADDING_SIZE); - if (!par->extradata) { - par->extradata_size = 0; - return AVERROR(ENOMEM); - } + ret = ff_alloc_extradata(par, side_size); + if (ret < 0) + return ret; memcpy(par->extradata, side, side_size); - par->extradata_size = side_size; flv_write_codec_header(s, par, pkt->dts); } } |