diff options
author | Matthew Waters <matthew@centricular.com> | 2020-06-25 09:35:45 +0300 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2020-09-21 05:08:14 +0300 |
commit | 37f0119f49904b186f1f237872535a7f30003eb5 (patch) | |
tree | 930526e55b46c4c28d8fef3fc61fdad7d9bfdabd | |
parent | 868149ca5a3a481703b47121a68082d13f1ac8ea (diff) |
qtdemux: bail out when encountering an atom with a size of 0
A size 0 atom means the atom extends to the end of the file. No further
valid atoms will ever follow. Avoids a subsequent scan for an atom from
one byte earlier after encountering a size 0 atom.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/643>
-rw-r--r-- | gst/isomp4/qtdemux.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index d4e127bf2..8fd74b892 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -8833,13 +8833,15 @@ qtdemux_find_atom (GstQTDemux * qtdemux, guint64 * offset, } if (lfourcc == fourcc) { - GST_DEBUG_OBJECT (qtdemux, "found fourcc at offset %" G_GUINT64_FORMAT, - *offset); + GST_DEBUG_OBJECT (qtdemux, "found '%" GST_FOURCC_FORMAT " at offset %" + G_GUINT64_FORMAT, GST_FOURCC_ARGS (fourcc), *offset); break; } else { GST_LOG_OBJECT (qtdemux, "skipping atom '%" GST_FOURCC_FORMAT "' at %" G_GUINT64_FORMAT, - GST_FOURCC_ARGS (fourcc), *offset); + GST_FOURCC_ARGS (lfourcc), *offset); + if (*offset == G_MAXUINT64) + goto locate_failed; *offset += *length; } } |