Skip to content

mkvalidator v0.6.0 crashes and master segfaults against sample .mkv #211

@xlikewise

Description

@xlikewise

This happens against real video files too, but this is a short repro using source builds on Linux.

Repro:

  1. Generate dummy video
/mnt/tmp/ # ffmpeg -f lavfi -i color=size=1280x720:duration=5:rate=25:color=black -f lavfi -i anullsrc=r=44100:cl=stereo -c:v libx264 -c:a aac -shortest dummy.mkv
ffmpeg version 6.1.2 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 14.2.0 (Alpine 14.2.0)
  configuration: --prefix=/usr --disable-librtmp --disable-lzma --disable-static --disable-stripping --enable-avfilter --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libmp3lame --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librist --enable-libsoxr --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-lto=auto --enable-lv2 --enable-openssl --enable-pic --enable-postproc --enable-pthreads --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-vulkan --optflags=-O3 --enable-libjxl --enable-libsvtav1 --enable-libvpl
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
Input #0, lavfi, from 'color=size=1280x720:duration=5:rate=25:color=black':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: wrapped_avframe, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn
Input #1, lavfi, from 'anullsrc=r=44100:cl=stereo':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
  Stream #1:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_u8 (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7f30d2bab940] using SAR=1/1
[libx264 @ 0x7f30d2bab940] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7f30d2bab940] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x7f30d2bab940] 264 - core 164 r3108 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=22 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'dummy.mkv':
  Metadata:
    encoder         : Lavf60.16.100
  Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 1k tbn
    Metadata:
      encoder         : Lavc60.31.102 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc60.31.102 aac
[out#0/matroska @ 0x7f30da3d0580] video:6kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 39.901823%
frame=  125 fps=101 q=-1.0 Lsize=      10kB time=00:00:04.96 bitrate=  16.1kbits/s speed=4.02x
[libx264 @ 0x7f30d2bab940] frame I:1     Avg QP: 9.00  size:   215
[libx264 @ 0x7f30d2bab940] frame P:31    Avg QP: 9.23  size:    46
[libx264 @ 0x7f30d2bab940] frame B:93    Avg QP:12.67  size:    38
[libx264 @ 0x7f30d2bab940] consecutive B-frames:  0.8%  0.0%  0.0% 99.2%
[libx264 @ 0x7f30d2bab940] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x7f30d2bab940] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 0x7f30d2bab940] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%
[libx264 @ 0x7f30d2bab940] 8x8 transform intra:0.0%
[libx264 @ 0x7f30d2bab940] coded y,uvDC,uvAC intra: 0.0% 0.0% 0.0% inter: 0.0% 0.0% 0.0%
[libx264 @ 0x7f30d2bab940] i16 v,h,dc,p: 98%  0%  2%  0%
[libx264 @ 0x7f30d2bab940] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 0x7f30d2bab940] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7f30d2bab940] kb/s:8.22
[aac @ 0x7f30d27ff8c0] Qavg: 65536.000
  1. Run mkvalidator against video
/mnt/tmp/ # foundation-source/build/mkvalidator/mkvalidator dummy.mkv
..Segmentation fault (core dumped)
/mnt/tmp/ # mkvalidator-0.6.0/build/mkvalidator/mkvalidator dummy.mkv
mkvalidator 0.6.0: the file appears to be valid
        file "dummy.mkv"
        created with Lavf60.16.100 / Lavf60.16.100
Assertion failed: p->Base.Base.RefCount==1 (/mnt/mkvalidator-0.6.0/corec/corec/node/node.c: NodeContext_Done: 2807)
Aborted (core dumped)

gcc version:

/mnt/tmp/ # gcc --version
gcc (Alpine 14.2.0) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions