Opened 5 years ago

Closed 5 years ago

#1889 closed defect (fixed)

wavpack: huge memory allocation with prepared file

Reported by: ami_stuff Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

should I report problems like this or only crashes?

C:\>ffmpeg -i mem.mkv -f null -
ffmpeg version N-46283-g1475815 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov  2 2012 02:31:20 with gcc 4.5.0 (GCC) 20100414 (Fedora MinGW 4.5.
0-1.fc14)
  configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect
--enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -
lwinmm -lpthread' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snap
shots/build/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/s
napshots/build/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3
--enable-nonfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-
libvorbis --enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
  libavutil      52.  1.100 / 52.  1.100
  libavcodec     54. 70.100 / 54. 70.100
  libavformat    54. 35.100 / 54. 35.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 21.106 /  3. 21.106
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[matroska,webm @ 0x1edc2c0] Estimating duration from bitrate, this may be inaccu
rate
Input #0, matroska,webm, from 'mem.mkv':
  Metadata:
    ENCODER         : Lavf54.35.100
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: wavpack, 16000 Hz, mono, s16 (default)
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf54.35.100
    Stream #0:0: Audio: pcm_s16le, 16000 Hz, mono, s16, 256 kb/s (default)
Stream mapping:
  Stream #0:0 -> #0:0 (wavpack -> pcm_s16le)
Press [q] to stop, [?] for help
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
Invalid number of samples: -1955236267te=   0.0kbits/s
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -521203691
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1658698091
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1159073963
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1414440939
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1166962603
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1777631658
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1123563819
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1374157226
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -638010538
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -485775323
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -303249323
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1667421863
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1517418155
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1298639766
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1528407975
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1427934123
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1684967595
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1257802907
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -1013899627
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -12 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -334279591
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -437179051
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -829239467
Error while decoding stream #0:0: Error number -22 occurred
[wavpack @ 0x1fc08e0] Invalid number of samples: -2040900715
Error while decoding stream #0:0: Error number -22 occurred
size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead nan%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters i
f used)

Attachments (1)

mem.mkv (204.0 KB) - added by ami_stuff 5 years ago.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by ami_stuff

comment:1 Changed 5 years ago by cehoyos

  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

Does not crash if I limit the thread's memory.

$ valgrind ./ffmpeg_g -i mem.mkv -f null -
==26374== Memcheck, a memory error detector
==26374== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==26374== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==26374== Command: ./ffmpeg_g -i mem.mkv -f null -
==26374==
ffmpeg version N-46479-g6a30233 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov  6 2012 08:41:39 with gcc 4.7 (SUSE Linux)
  configuration: --disable-indev=jack
  libavutil      52.  5.100 / 52.  5.100
  libavcodec     54. 71.100 / 54. 71.100
  libavformat    54. 36.100 / 54. 36.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 21.106 /  3. 21.106
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
[matroska,webm @ 0x66b2c80] Estimating duration from bitrate, this may be inaccurate
Input #0, matroska,webm, from 'mem.mkv':
  Metadata:
    ENCODER         : Lavf54.35.100
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: wavpack, 16000 Hz, mono, s16 (default)
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf54.36.100
    Stream #0:0: Audio: pcm_s16le, 16000 Hz, mono, s16, 256 kb/s (default)
Stream mapping:
  Stream #0:0 -> #0:0 (wavpack -> pcm_s16le)
Press [q] to stop, [?] for help
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
==26374== Warning: set address range perms: large range [0x3943e080, 0xa4d6f800) (undefined)
[wavpack @ 0x66ca8e0] Block size 4895972 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
==26374== Warning: set address range perms: large range [0x3943e070, 0xa4d6f810) (noaccess)
==26374== Warning: set address range perms: large range [0xa4d70080, 0x116938600) (undefined)
[wavpack @ 0x66ca8e0] Block size 18151338 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s 
Invalid number of samples: -1955236267
Error while decoding stream #0:0: Invalid argument
size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s
get_buffer() failed
[wavpack @ 0x66ca8e0] Invalid number of samples: -521203691
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Block size 5262283 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
[wavpack @ 0x66ca8e0] Invalid number of samples: -1658698091
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1159073963
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1414440939
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1166962603
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1777631658
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1123563819
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1374157226
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -638010538
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
==26374== Warning: set address range perms: large range [0xa4d70070, 0x116938610) (noaccess)
==26374== Warning: set address range perms: large range [0x116939080, 0x19344c380) (undefined)
[wavpack @ 0x66ca8e0] Block size 13280210 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
[wavpack @ 0x66ca8e0] Invalid number of samples: -485775323
Error while decoding stream #0:0: Invalid argument
size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s
Invalid number of samples: -303249323
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1667421863
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Block size 12921938 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
[wavpack @ 0x66ca8e0] Block size 6845713 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1517418155
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1298639766
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1528407975
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1427934123
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1684967595
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Block size 28527950 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1257802907
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid FLOATINFO, size = 193
[wavpack @ 0x66ca8e0] Block size 3964690 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
[wavpack @ 0x66ca8e0] Block size 3949190 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -1013899627
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Block size 23276196 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
[wavpack @ 0x66ca8e0] Block size 11227985 is out of bounds
[wavpack @ 0x66ca8e0] No block with decorrelation terms
Error while decoding stream #0:0: Operation not permitted
[wavpack @ 0x66ca8e0] Invalid number of samples: -334279591
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -437179051
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -829239467
Error while decoding stream #0:0: Invalid argument
[wavpack @ 0x66ca8e0] Invalid number of samples: -2040900715
Error while decoding stream #0:0: Invalid argument
size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    ^M
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead -nan%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
==26374== Warning: set address range perms: large range [0x116939070, 0x19344c390) (noaccess)
==26374==
==26374== HEAP SUMMARY:
==26374==     in use at exit: 0 bytes in 0 blocks
==26374==   total heap usage: 603 allocs, 603 frees, 5,805,718,221 bytes allocated
==26374==
==26374== All heap blocks were freed -- no leaks are possible
==26374==
==26374== For counts of detected and suppressed errors, rerun with: -v
==26374== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)

comment:2 Changed 5 years ago by richardpl

  • Analyzed by developer set
  • Component changed from undetermined to avcodec
  • Resolution set to fixed
  • Status changed from open to closed

Yes, reporting problems with big memory allocations is welcome.

Note: See TracTickets for help on using tickets.