Opened 3 years ago

#9373 new defect

av_assert0(matroska->num_levels <= 2) assertion failure

Reported by: lemourin Owned by:
Priority: normal Component: avformat
Version: git-master Keywords:
Cc: lemourin Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

The assert here gets triggered.

#0  0x00007f55270a6d22 in raise () from /usr/lib/libc.so.6
#1  0x00007f5527090862 in abort () from /usr/lib/libc.so.6
#2  0x00007f55283b975a in matroska_parse_cluster (matroska=0x61c0000e0080) at src/libavformat/matroskadec.c:3738
#3  0x00007f55283b1ef3 in matroska_read_packet (s=0x616000129380, pkt=0x6100000db740) at src/libavformat/matroskadec.c:3801
#4  0x00007f55284eafa3 in ff_read_packet (s=0x616000129380, pkt=0x6100000db740) at src/libavformat/utils.c:801
#5  0x00007f55284ec844 in read_frame_internal (s=0x616000129380, pkt=0x6100000db740) at src/libavformat/utils.c:1491
#6  0x00007f55284ec3b0 in av_read_frame (s=0x616000129380, pkt=0x6100000db740) at src/libavformat/utils.c:1680
#n  my code follows

How to reproduce:

I'm using FFmpeg libraries to generate thumbnails for videos located in some cloud storage. Sometimes, when generating a thumbnail for an mkv file the above mentioned assert gets triggered. This happens only when the thumbnail generation is interrupted.

I have a custom AVIOContext which is backed by network. Reads from this AVIOContext can be cancelled externally via the stop_token. These cancellations are then propagated to FFmpeg by returning AVERROR(EIO) from the read function.

If you're willing to run the program which does all this the source is here; configure with BUILD_SHARED_LIBS=ON to build using system dependencies; only clang is supported. Then:

  • run coro-cloudstorage-fuse
  • visit localhost:12345
  • login with hubiC (I only generate thumbnails for this cloud with FFmpeg; they don't generate them server side)
  • upload a couple of mkvs there (e.g by using their web ui)
  • go back to localhost:12345 and browse the uploaded mkv files
  • the browser will trigger thumbnail generation for these files
  • interrupt the page load; repeat enough times until the assert is triggered

Change History (0)

Note: See TracTickets for help on using tickets.