summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2014-02-19 17:43:46 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-20 02:58:39 +0100
commit916a79227e0dbeb8c1a2b7285b959729fa53e470 (patch)
treef289c4e9b7e2ed29860457b7a2b5b844c1e22644 /libavformat
parentcbd9cc5997ec728a5c92b6cafe57412d5869ec74 (diff)
lavf/mux: check av_dup_packet() return value.
Signed-off-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index c535c82a61..2241dbe0e6 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -639,6 +639,7 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
AVPacketList **next_point, *this_pktl;
AVStream *st = s->streams[pkt->stream_index];
int chunked = s->max_chunk_size || s->max_chunk_duration;
+ int ret;
this_pktl = av_mallocz(sizeof(AVPacketList));
if (!this_pktl)
@@ -654,7 +655,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_assert0(pkt->size == UNCODED_FRAME_PACKET_SIZE);
av_assert0(((AVFrame *)pkt->data)->buf);
} else {
- av_dup_packet(&this_pktl->pkt); // duplicate the packet if it uses non-allocated memory
+ // duplicate the packet if it uses non-allocated memory
+ if ((ret = av_dup_packet(&this_pktl->pkt)) < 0) {
+ av_free(this_pktl);
+ return ret;
+ }
av_copy_packet_side_data(&this_pktl->pkt, &this_pktl->pkt); // copy side data
}