diff --git a/libavformat/mov.c b/libavformat/mov.c index 0ce63209ddf4f0bec67585ef05451fb3d52fca06..0972f7316dd964a1275dac72a2114bc093725624 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -181,8 +181,7 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) a.size -= 8; if(a.size < 0) break; - if (a.size > atom.size - total_size) - a.size = atom.size - total_size; + a.size = FFMIN(a.size, atom.size - total_size); for (i = 0; c->parse_table[i].type != 0L && c->parse_table[i].type != a.type; i++)