avformat/test/fifo_muxer: add check for FailingMuxerPacketData alloc

CID: 1396257

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu 2017-01-06 06:35:32 +08:00
parent 2d208aaabe
commit d1f3e475f9
1 changed files with 3 additions and 0 deletions

View File

@ -151,6 +151,9 @@ static int prepare_packet(AVPacket *pkt,const FailingMuxerPacketData *pkt_data,
{
int ret;
FailingMuxerPacketData *data = av_malloc(sizeof(*data));
if (!data) {
return AVERROR(ENOMEM);
}
memcpy(data, pkt_data, sizeof(FailingMuxerPacketData));
ret = av_packet_from_data(pkt, (uint8_t*) data, sizeof(*data));