[FFmpeg-cvslog] audiointerleave: check av_new_packet return value
Vittorio Giovara
git at videolan.org
Sun Jan 18 01:28:52 CET 2015
ffmpeg | branch: release/2.4 | Vittorio Giovara <vittorio.giovara at gmail.com> | Mon Oct 20 14:11:14 2014 +0100| [7c710c38f6481b892e01d3c1e4781ad160b2935e] | committer: Vittorio Giovara
audiointerleave: check av_new_packet return value
CC: libav-stable at libav.org
Bug-Id: CID 1087078
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c710c38f6481b892e01d3c1e4781ad160b2935e
---
libavformat/audiointerleave.c | 6 ++++--
1 file 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;
More information about the ffmpeg-cvslog
mailing list