[FFmpeg-devel] [PATCH] mov: avoid giant skips

Reimar Döffinger Reimar.Doeffinger
Sat Feb 20 18:39:59 CET 2010


Hello,
when in mov_read_default the atom size is < 0, it is set to
INT64_MAX instead to allow guessing the size from the contained
sub-atoms.
However when we fail to get a valid size for those, there is another
fallback to the surrounding atom size.
This is unlikely to be a useful fallback if we never knew the outer
atom size and also will result in url_fskip being called with insanely
large value.
While that's mostly a cosmetic issue I still propose patch below:
Index: libavformat/mov.c
===================================================================
--- libavformat/mov.c	(revision 21899)
+++ libavformat/mov.c	(working copy)
@@ -199,7 +199,7 @@
             a.size = get_be64(pb) - 8;
             total_size += 8;
         }
-        if (a.size == 0) {
+        if (a.size == 0 && atom.size != INT64_MAX) {
             a.size = atom.size - total_size;
             if (a.size <= 8)
                 break;




More information about the ffmpeg-devel mailing list