changeset 2807:5bf4b9df2794 libavformat

return error if malloc failed, found by takis, fix issue 286
author bcoudurier
date Mon, 03 Dec 2007 22:26:07 +0000
parents 1ce39cda4a59
children a8b9018a4ffb
files mov.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Mon Dec 03 22:22:50 2007 +0000
+++ b/mov.c	Mon Dec 03 22:26:07 2007 +0000
@@ -964,7 +964,8 @@
 
     sc->stts_count = entries;
     sc->stts_data = av_malloc(entries * sizeof(MOV_stts_t));
-
+    if (!sc->stts_data)
+        return -1;
     dprintf(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
 
     sc->time_rate=0;
@@ -1006,7 +1007,8 @@
 
     sc->ctts_count = entries;
     sc->ctts_data = av_malloc(entries * sizeof(MOV_stts_t));
-
+    if (!sc->ctts_data)
+        return -1;
     dprintf(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
 
     for(i=0; i<entries; i++) {