Skip to content

Harden LegacyMicroVideoProvider with Xiaomi MVIMG ftyp fallback and zero-regex XMP parser - #14

Open
DichenZhang1 wants to merge 1 commit into
Developmentfrom
feat/plugin-legacy-microvideo-hardening
Open

DichenZhang1 wants to merge 1 commit into
Developmentfrom
feat/plugin-legacy-microvideo-hardening

Conversation

@DichenZhang1

Copy link
Copy Markdown
Collaborator

Summary

Hardens the legacy_micro_video 3P plugin with a zero-regex XMP parser and an ISO BMFF ftyp forward-scan fallback for legacy Xiaomi MVIMG files with inaccurate GCamera:MicroVideoOffset values.

Key Changes

  • Zero-Regex XMP Extraction (legacy_micro_video_provider.cc):
    • Replaces std::regex in ExtractInt64Attr with fast absl::string_view parsing supporting both XML attributes (GCamera:MicroVideo="1", Camera:MicroVideo='1') and XML child elements (<Camera:MicroVideo>1</Camera:MicroVideo>).
  • Xiaomi MVIMG Offset Drift Fallback (FindMp4StartInTrailer):
    • Scans forward in container.trailer for a valid [u32be box_size]["ftyp"] header when MicroVideoOffset is drifted or preceded by padding after EOI, returning the exact MP4 start offset and length in GetVideoInfo.
    • Excludes trailers carrying 3P proprietary footers (SEFT, jxrs, HiHonor_*, LivePhoto_*, LIVE_*).
  • Tests (legacy_micro_video_provider_test.cc):
    • Adds unit and end-to-end extraction tests for XML child-element syntax, Xiaomi MVIMG drifted ftyp offset recovery, and proprietary trailer exclusion.

@DichenZhang1
DichenZhang1 force-pushed the feat/plugin-legacy-microvideo-hardening branch from d09b154 to 28c3313 Compare October 12, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant