1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

audiointerleave: check av_new_packet return value

CC: libav-stable@libav.org
Bug-Id: CID 1087078
This commit is contained in:
Vittorio Giovara 2014-10-20 14:11:14 +01:00
parent ac84c1ce24
commit 1967cd4e4c

View File

@ -75,12 +75,14 @@ static int interleave_new_audio_packet(AVFormatContext *s, AVPacket *pkt,
{
AVStream *st = s->streams[stream_index];
AudioInterleaveContext *aic = st->priv_data;
int ret;
int size = FFMIN(av_fifo_size(aic->fifo), *aic->samples * aic->sample_size);
if (!size || (!flush && size == av_fifo_size(aic->fifo)))
return 0;
av_new_packet(pkt, size);
ret = av_new_packet(pkt, size);
if (ret < 0)
return ret;
av_fifo_generic_read(aic->fifo, pkt->data, size, NULL);
pkt->dts = pkt->pts = aic->dts;