summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-10-22 14:36:14 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-10-22 14:36:14 +0000
commit8622613d9f74e0ce5e248905f3f554d26f6d6c06 (patch)
tree834dd952c9cf6dfb1df014037210293a643ab83c /libavformat/mov.c
parentbf672ac73f37c21bd87dca63ea9f65de98958baf (diff)
fix issue 225, instead of stoping when wrong atom size is found,
limit atom size to what is left, assuming container atom has correct size.. cricket4.3g2 has incorrect moov atom size which indicates that file size should be 2 bytes bigger than it is and quicktime reads it correctly though. Originally committed as revision 10836 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index e9b6c761f4..0ce63209dd 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -179,8 +179,10 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
break;
}
a.size -= 8;
- if(a.size < 0 || a.size > atom.size - total_size)
+ if(a.size < 0)
break;
+ if (a.size > atom.size - total_size)
+ a.size = atom.size - total_size;
for (i = 0; c->parse_table[i].type != 0L
&& c->parse_table[i].type != a.type; i++)