aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/gxfenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-11 10:54:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-11 11:23:40 +0200
commitcbe47b1e8452e37fda592941e7d3f3bb5920c201 (patch)
tree9ea8b6418c4d89e27c98314d41974163b5dbafe8 /libavformat/gxfenc.c
parent64b6279d1414378214a58a55f0066fbc95256c9b (diff)
parentf369b9356c4606cd4d713d60f7db5de119d901fa (diff)
downloadffmpeg-cbe47b1e8452e37fda592941e7d3f3bb5920c201.tar.gz
Merge commit 'f369b9356c4606cd4d713d60f7db5de119d901fa'
* commit 'f369b9356c4606cd4d713d60f7db5de119d901fa': avformat: Use av_reallocp_array() where suitable Conflicts: libavformat/asfenc.c libavformat/gxfenc.c libavformat/mov.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/gxfenc.c')
-rw-r--r--libavformat/gxfenc.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 57bb26cd0d..50c0b52d05 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -381,12 +381,13 @@ static int gxf_write_map_packet(AVFormatContext *s, int rewrite)
if (!rewrite) {
if (!(gxf->map_offsets_nb % 30)) {
- gxf->map_offsets = av_realloc_f(gxf->map_offsets,
- sizeof(*gxf->map_offsets),
- gxf->map_offsets_nb+30);
- if (!gxf->map_offsets) {
+ int err;
+ if ((err = av_reallocp_array(&gxf->map_offsets,
+ gxf->map_offsets_nb + 30,
+ sizeof(*gxf->map_offsets))) < 0) {
+ gxf->map_offsets_nb = 0;
av_log(s, AV_LOG_ERROR, "could not realloc map offsets\n");
- return -1;
+ return err;
}
}
gxf->map_offsets[gxf->map_offsets_nb++] = pos; // do not increment here
@@ -956,12 +957,13 @@ static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt)
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
if (!(gxf->flt_entries_nb % 500)) {
- gxf->flt_entries = av_realloc_f(gxf->flt_entries,
- sizeof(*gxf->flt_entries),
- gxf->flt_entries_nb+500);
- if (!gxf->flt_entries) {
+ int err;
+ if ((err = av_reallocp_array(&gxf->flt_entries,
+ gxf->flt_entries_nb + 500,
+ sizeof(*gxf->flt_entries))) < 0) {
+ gxf->flt_entries_nb = 0;
av_log(s, AV_LOG_ERROR, "could not reallocate flt entries\n");
- return -1;
+ return err;
}
}
gxf->flt_entries[gxf->flt_entries_nb++] = packet_start_offset;