aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/nut.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-12 16:51:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-12 16:51:26 +0100
commitf479c178943fdaee5f8d92f88658c57bec3e40b3 (patch)
treeeee37f3280b03504e69abc0cf7c7f9a49129cf3b /libavformat/nut.c
parent1203e92181b4c4af4ba1aa0edc1da3ae8447f9b4 (diff)
parent65830277d2d2ee3658e1f070a61044fff261ed3e (diff)
downloadffmpeg-f479c178943fdaee5f8d92f88658c57bec3e40b3.tar.gz
Merge commit '65830277d2d2ee3658e1f070a61044fff261ed3e' into release/1.1
* commit '65830277d2d2ee3658e1f070a61044fff261ed3e': prores: Add a codepath for decoding errors nut: Fix unchecked allocations avi: directly resync on DV in AVI read failure mov: Don't allocate arrays with av_malloc that will be realloced shorten: Extend fixed_coeffs to properly support pred_order 0 Prepare for 9.11 RELEASE avi: properly fail if the dv demuxer is missing prores: Reject negative run and level values audio_mix: fix channel order in mix_1_to_2_fltp_flt_c indeo4: Check the inherited quant_mat Conflicts: RELEASE libavcodec/indeo4.c libavcodec/shorten.c libavformat/nut.c libavformat/nutdec.c libavformat/nutenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/nut.c')
-rw-r--r--libavformat/nut.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/nut.c b/libavformat/nut.c
index 62a650dbed..699e90a2b8 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -210,10 +210,16 @@ int ff_nut_sp_pts_cmp(const Syncpoint *a, const Syncpoint *b){
return ((a->ts - b->ts) >> 32) - ((b->ts - a->ts) >> 32);
}
-void ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts){
+int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts){
Syncpoint *sp= av_mallocz(sizeof(Syncpoint));
struct AVTreeNode *node = av_tree_node_alloc();
+ if (!sp || !node) {
+ av_freep(&sp);
+ av_freep(&node);
+ return AVERROR(ENOMEM);
+ }
+
nut->sp_count++;
sp->pos= pos;
@@ -224,6 +230,8 @@ void ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts){
av_free(sp);
av_free(node);
}
+
+ return 0;
}
static int enu_free(void *opaque, void *elem)