Opened 3 months ago

Closed 2 months ago

#11124 closed defect (invalid)

encounter "Cannot allocate memory" when opening a media file

Reported by: kmfl Owned by:
Priority: important Component: ffmpeg
Version: git-master Keywords:
Cc: kmfl Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
encounter "Cannot allocate memory" when opening a media file, and ffmpeg exited with code 0364

How to reproduce:

 /home/ffmpeg-debug/ffmpeg_g -i memory_bug test

Full console output:

root@Lab649-v100:/home/crash_test# /home/ffmpeg-debug/ffmpeg_g -v 9 -loglevel 99 -i memory_bug test
ffmpeg version N-116527-g9a2171318d Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
  configuration: --disable-shared --pkg-config-flags=--static --extra-libs='-lpthread -lm' --enable-gpl --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libx264 --enable-libx265 --enable-nonfree --enable-debug
  libavutil      59. 31.100 / 59. 31.100
  libavcodec     61. 11.100 / 61. 11.100
  libavformat    61.  5.101 / 61.  5.101
  libavdevice    61.  2.100 / 61.  2.100
  libavfilter    10.  2.102 / 10.  2.102
  libswscale      8.  2.100 /  8.  2.100
  libswresample   5.  2.100 /  5.  2.100
  libpostproc    58.  2.100 / 58.  2.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-i' ... matched as input url with argument 'memory_bug'.
Reading option 'test' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input url memory_bug.
Successfully parsed a group of options.
Opening an input file: memory_bug.
[AVFormatContext @ 0x557c02cff9c0] Opening 'memory_bug' for reading
[file @ 0x557c02d00280] Setting default whitelist 'file,crypto,data'
Probing iamf score:51 size:538
Probing mp3 score:1 size:538
[iamf @ 0x557c02cff9c0] Format iamf probed with size=2048 and score=51
[iamf @ 0x557c02cff9c0] Failed to read obu type 2
[AVIOContext @ 0x557c02d08640] Statistics: 538 bytes read, 0 seeks
[in#0 @ 0x557c02cff680] Error opening input: Cannot allocate memory
Error opening input file memory_bug.
Error opening input files: Cannot allocate memory

Attachments (1)

memory_bug (538 bytes ) - added by kmfl 3 months ago.
Poc to trigger this bug

Download all attachments as: .zip

Change History (2)

by kmfl, 3 months ago

Attachment: memory_bug added

Poc to trigger this bug

comment:1 by James, 2 months ago

Resolution: invalid
Status: newclosed

How is this a bug? The demuxer evidently read a value from this fuzzed input supposed to be a byte size count to be allocated, which is impossibly big and so it fails and gracefully aborts.

Note: See TracTickets for help on using tickets.