视频文件如何导致 iOS 设备崩溃或挂起?

逆向工程 ios
2021-06-13 05:31:57

有报告称,错误的 h264 视频文件导致 iOS 设备挂起或崩溃(我已添加纯文本链接以避免意外点击,播放风险自负:)http://www.apps4iphone.net/videocrash.html我正在尝试对该文件进行逆向工程,以了解它为何以及如何危害 iOS 设备。

使用 Mediainfo Mac 查看文件似乎没有任何异常:

* * * MediaInfo Mac 0.7.36.0 file analysis report.
* * * MediaInfo Mac is ©2010 by Diego Massanti - http://mediainfo.massanti.com
* * * MediaInfoLib by Jerome Martinez - http://mediainfo.sourceforge.net
Created on: Nov 22, 2016, 1:55:04 PM EST
Report for file: IMG_0942.mp4

General / Container Stream #1
    Total Video Streams for this File.................1
    Total Audio Streams for this File.................1
    Video Codecs Used.................................AVC
    Audio Codecs Used.................................AAC LC
    File Format.......................................MPEG-4
    Play Time.........................................5s 6ms
    Total File Size...................................527 KiB
    Total Stream BitRate..............................863 Kbps
Video Stream #1
    Codec (Human Name)................................AVC
    Codec (FourCC)....................................avc1
    Codec Profile.....................................Baseline@L3.0
    Frame Width.......................................480 pixels
    Frame Height......................................480 pixels
    Frame Rate........................................25.000 fps
    Total Frames......................................126
    Display Aspect Ratio..............................1.000
    Scan Type.........................................Progressive
    Color Space.......................................YUV
    Codec Settings (Summary)..........................1 Ref Frames
    QF (like Gordian Knot)............................0.137
    Codec Settings (CABAC)............................No
    Codec Settings (Reference Frames).................1
    Video Stream Length...............................5s 6ms
    Video Stream BitRate..............................789 Kbps
    Video Stream BitRate Mode.........................VBR
    Bit Depth.........................................8 bits
    Video Stream Size.................................486 KiB (92%)
    Video Stream Title................................Core Media Video
    Date of Original Encoding.........................UTC 2016-11-17 20:14:29
Audio Stream #1
    Codec.............................................AAC
    Codec (FourCC)....................................40
    Audio Stream Length...............................4s 504ms
    Audio Stream BitRate..............................72.0 Kbps
    Audio Stream BitRate Mode.........................CBR
    Number of Audio Channels..........................1
    Audio Channel's Positions.........................Front: C
    Sampling Rate.....................................44.1 KHz
    Audio Stream Size.................................39.2 KiB (7%)
    Audio Stream Title................................Core Media Audio
    Date of Original Encoding.........................UTC 2016-11-17 20:14:29

ffprobe 输出:

➜  Downloads ffprobe IMG_0942.mp4
ffprobe version 3.2 Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_0942.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp41mp42isom
    creation_time   : 2016-11-17T20:14:29.000000Z
  Duration: 00:00:05.01, start: 0.000000, bitrate: 862 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 71 kb/s (default)
    Metadata:
      creation_time   : 2016-11-17T20:14:29.000000Z
      handler_name    : Core Media Audio
    Stream #0:1(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 480x480, 794 kb/s, 25.17 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      creation_time   : 2016-11-17T20:14:29.000000Z
      handler_name    : Core Media Video

我不确定在 Mac 上读取视频文件标题内容的最佳方式。但是什么会导致此视频挂起 iOS 设备?它是格式错误的标题吗?元数据或视频流损坏?另请注意,这不会使 Mac 上的 Quicktime 或 iOS 模拟器上的 Safari/AVFoundation 崩溃。

1个回答

我一直在研究同样的问题,虽然我还没有找到导致问题的确切原因。我尝试使用 ffmpeg 来查找一些信息。运行时:

ffmpeg -v error -i IMG_0942.mp4 -f null - 2> IMG_0942.mp4.log

它产生以下结果:

[h264 @ 0x8f4720] top block unavailable for requested intra4x4 mode -1 at 0 0 
[h264 @ 0x8f4720] error while decoding MB 0 0

不确定您是否知道如何阅读它或它的含义(我不知道),但它确实有助于演示一种找到问题所在的方法。

如果您在此问题上取得更多进展,请告诉我。