diff options
author | Panagiotis Issaris <takis.issaris@uhasselt.be> | 2007-12-03 22:22:50 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-12-03 22:22:50 +0000 |
commit | 9cf0419bb1a2cf929dcf458d435ae3c3bfb5d3ab (patch) | |
tree | 1e8c97d5099e4aa26770f86172687169e8e9949a /libavformat/mov.c | |
parent | b529ab37ba40f93be54d27629a3df63bb9f5114e (diff) | |
download | ffmpeg-9cf0419bb1a2cf929dcf458d435ae3c3bfb5d3ab.tar.gz |
check mov_read_default return value where appropriate, patch by takis, fix issue 285
Originally committed as revision 11161 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index dc662d3a4d..1c2f3226ea 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -345,9 +345,8 @@ static int mov_read_ftyp(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) /* this atom should contain all header atoms */ static int mov_read_moov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) { - int err; - - err = mov_read_default(c, pb, atom); + if (mov_read_default(c, pb, atom) < 0) + return -1; /* we parsed the 'moov' atom, we can terminate the parsing as soon as we find the 'mdat' */ /* so we don't parse the whole file if over a network */ c->found_moov=1; @@ -505,7 +504,8 @@ static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) } else url_fskip(pb, atom.size); } else if (atom.size > 8) { /* to read frma, esds atoms */ - mov_read_default(c, pb, atom); + if (mov_read_default(c, pb, atom) < 0) + return -1; } else url_fskip(pb, atom.size); return 0; @@ -789,9 +789,10 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) } /* this will read extra atoms at the end (wave, alac, damr, avcC, SMI ...) */ a.size = size - (url_ftell(pb) - start_pos); - if (a.size > 8) - mov_read_default(c, pb, a); - else if (a.size > 0) + if (a.size > 8) { + if (mov_read_default(c, pb, a) < 0) + return -1; + } else if (a.size > 0) url_fskip(pb, a.size); } |