mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-12-03 00:56:54 +00:00
avformat/flvenc: Check for extradata allocation failure
Fixes CID1396539 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e8651f51aa
commit
4221c68edb
@ -890,6 +890,10 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
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);
|
||||
}
|
||||
memcpy(par->extradata, side, side_size);
|
||||
par->extradata_size = side_size;
|
||||
flv_write_codec_header(s, par);
|
||||
|
Loading…
Reference in New Issue
Block a user