summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-10-20 14:11:14 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-24 23:42:53 +0100
commit1967cd4e4c1cd96dfa195ce14e4b212ddb70586d (patch)
tree61dad57b702de50c7d99d6465bd46e47faa0b6da
parentac84c1ce24a285f9cf16d4297bce73b1c4a6e435 (diff)
downloadffmpeg-streaming-1967cd4e4c1cd96dfa195ce14e4b212ddb70586d.zip
ffmpeg-streaming-1967cd4e4c1cd96dfa195ce14e4b212ddb70586d.tar.gz
audiointerleave: check av_new_packet return value
CC: libav-stable@libav.org Bug-Id: CID 1087078
-rw-r--r--libavformat/audiointerleave.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/audiointerleave.c b/libavformat/audiointerleave.c
index e49c77f..ba78d4e 100644
--- a/libavformat/audiointerleave.c
+++ b/libavformat/audiointerleave.c
@@ -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;
OpenPOWER on IntegriCloud