aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/audiointerleave.c
diff options
context:
space:
mode:
authorNidhi Makhijani <nidhimj22@gmail.com>2014-07-14 11:52:44 +0530
committerDiego Biurrun <diego@biurrun.de>2014-07-17 03:18:46 -0700
commit324ff59444ff5470bb325ff1e2be7c4b054fc944 (patch)
tree787e31d54ea7f2b4f94e3aec84afbb62bb98c9e0 /libavformat/audiointerleave.c
parent2db953f84671997e936f91140ffb5143c1537844 (diff)
downloadffmpeg-324ff59444ff5470bb325ff1e2be7c4b054fc944.tar.gz
avpacket: Check for and return errors in ff_interleave_add_packet()
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/audiointerleave.c')
-rw-r--r--libavformat/audiointerleave.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/audiointerleave.c b/libavformat/audiointerleave.c
index e4cde9d0aa..e49c77fe0b 100644
--- a/libavformat/audiointerleave.c
+++ b/libavformat/audiointerleave.c
@@ -99,7 +99,7 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt
int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int),
int (*compare_ts)(AVFormatContext *, AVPacket *, AVPacket *))
{
- int i;
+ int i, ret;
if (pkt) {
AVStream *st = s->streams[pkt->stream_index];
@@ -116,7 +116,8 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt
// rewrite pts and dts to be decoded time line position
pkt->pts = pkt->dts = aic->dts;
aic->dts += pkt->duration;
- ff_interleave_add_packet(s, pkt, compare_ts);
+ if ((ret = ff_interleave_add_packet(s, pkt, compare_ts)) < 0)
+ return ret;
}
pkt = NULL;
}
@@ -126,7 +127,8 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
AVPacket new_pkt;
while (interleave_new_audio_packet(s, &new_pkt, i, flush))
- ff_interleave_add_packet(s, &new_pkt, compare_ts);
+ if ((ret = ff_interleave_add_packet(s, &new_pkt, compare_ts)) < 0)
+ return ret;
}
}