Opened 10 years ago

Closed 9 years ago

#2190 closed defect (fixed)

Assertion v>0 && v<=(1 ? 32 : 16) failed at libavutil/mem.c:226

Reported by: BuXY Owned by:
Priority: normal Component: mencoder
Version: unspecified Severity: normal
Keywords: x64 assert libavutil mem.c Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

Summary of the bug:
mencoder asserts

How to reproduce:

C:\>mencoder.exe file://testsource.avi -ffourcc DX50 -ovc lavc -lavcopts ildct:ilme:mpeg_quant:threads=4:vcodec=libxvid:keyint=25:vbitrate=1200 -oac mp3lame -lameopts cbr:br=160 -o test05_1_dx50.avi
MEncoder Redxii-SVN-r37216-4.8.2 (x86_64) (C) 2000-2014 MPlayer Team
Compiled against FFmpeg version N-63644-ge1bd40f
Build date: Sat May 31 23:09:47 EDT 2014
success: format: 0  data: 0x0 - 0x1cd8cc4
libavformat version 55.42.100 (internal)

... conversion goes fine until last frame ...

Pos: 174.3s   4361f (100%) 38.36fps Trem:   0min  28mb  A-V:0.006 [1226:160]

Flushing video frames.
Writing index...
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp h
eader.

Video stream: 1226.436 kbit/s  (153304 B/s)  size: 26724039 bytes  174.320 secs
 4361 frames

Audio stream:  160.000 kbit/s  (20000 B/s)  size: 3488160 bytes  174.408 secs
Assertion v>0 && v<=(1 ? 32 : 16) failed at libavutil/mem.c:226

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I'll try to attach the full console log of the conversion.
I can provide the testsource.avi (30 MB) if needed (file was created by VirtualDub build 35390/release direct stream copies. source: mencoder r34401 x86 DVB-C capture).

Attachments (3)

log.txt (3.1 KB ) - added by BuXY 10 years ago.
console log
mlog.txt (313.9 KB ) - added by redxii 9 years ago.
DrMemory-mencoder.exe.3324.000.tar (136.5 KB ) - added by redxii 9 years ago.

Download all attachments as: .zip

Change History (6)

by BuXY, 10 years ago

Attachment: log.txt added

console log

comment:1 by reimar, 9 years ago

Does this still exist?
I would mean that CONFIG_MEMALIGN_HACK was enabled and either there was memory corruption a normally allocated pointer was passed to av_free by mistake.
And yes a way to reproduce would be very welcome if it's still an issue.

by redxii, 9 years ago

Attachment: mlog.txt added

by redxii, 9 years ago

comment:2 by redxii, 9 years ago

I tested with latest svn/ffmpeg with AVI files I had on-hand and the message still appears (also even when aborting with Ctrl C). CONFIG_MEMALIGN_HACK is enabled by default by configure.

AFAIK Dr Memory doesn't support 64-bit binaries so I am providing a debug output of 32-bit which still shows the message. Hopefully it will provide some insight. I know GDB is useless for this error since I get a similar "This application has requested..." message attempting to play DVDs when libdvdcss & libfontconfig use CSIDL_APPDATA at the same time for their caches (css cache is disabled even in the 37216 build though as to not cause the conflict). I tried Sherpya's build and it had the same message so couldn't be my compiler...

C:\Users\Joshua\Desktop\mplayer-svn-37802-x86_64>mencoder.exe file://testsource.avi -ffourcc DX50 -ovc lavc -lavcopts ildct:ilme:mpeg_quant:threads=4:vcodec=lib
xvid:keyint=25:vbitrate=1200 -oac mp3lame -lameopts cbr:br=160 -o test05_1_dx50.avi -v
MEncoder SVN-r37802-4.9.3 (C) 2000-2016 MPlayer Team
get_path('codecs.conf') -> 'C:/Users/Joshua/Desktop/mplayer-svn-37802-x86_64/mplayer/codecs.conf'
Reading optional codecs config file C:/Users/Joshua/Desktop/mplayer-svn-37802-x86_64/mplayer/codecs.conf: No such file or directory
Reading optional codecs config file /usr/local/etc/mplayer/codecs.conf: No such file or directory
Using built-in default codecs.conf.
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
get_path('fonts') -> 'C:/Users/Joshua/Desktop/mplayer-svn-37802-x86_64/mplayer/fonts'
Configuration: --enable-static --enable-runtime-cpudetection --enable-menu --disable-inet6 --disable-liba52 --disable-libmpeg2-internal --disable-tv --disable-v
idix --disable-faac-lavc --extra-cflags=-I/sources/live555-x64 --disable-mplayer
WINSOCK2 init: 0
WINSOCK2 init: 0
[file] File size is 12603392 bytes
STREAM: [file] file://testsource.avi
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
success: format: 0  data: 0x0 - 0xc05000
libavformat version 57.26.100 (internal)
Configuration: --enable-gpl --enable-postproc
LAVF_check: AVI (Audio Video Interleaved)
AVI file format detected.
list_end=0x2286
======= AVI Header =======
us/frame: 33367  (fps=29.970)
max bytes/sec: 0
padding: 0
MainAVIHeader.dwFlags: (272) HAS_INDEX IS_INTERLEAVED
frames  total: 1353   initial: 0
streams: 2
Suggested BufferSize: 0
Size:  720 x 260
==========================
list_end=0x10F4
==> Found video stream: 0
[aviheader] Video stream found, -vid 0
====== STREAM Header =====
Type: vids   FCC: xvid (64697678)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 5000000/166833 = 29.970
Start: 0   Len: 1353
Suggested BufferSize: 65496
Quality 10000
Sample size: 0
==========================
Found 'bih', 40 bytes of 40
======= VIDEO Format ======
  biSize 40
  biWidth 720
  biHeight 260
  biPlanes 1
  biBitCount 12
  biCompression 1145656920='XVID'
  biSizeImage 1123200
===========================
Regenerating keyframe table for MPEG-4 video.
list_end=0x217A
==> Found audio stream: 1
[aviheader] Audio stream found, -aid 1
====== STREAM Header =====
Type: auds   FCC:  (0)
Flags: 1
Priority: 0   Language: 0
InitialFrames: 1
Rate: 56000/1 = 56000.000
Start: 0   Len: 2528150
Suggested BufferSize: 28000
Quality -1
Sample size: 1
==========================
Found 'wf', 18 bytes of 18
======= WAVE Format =======
Format Tag: 8192 (0x2000)
Channels: 5
Samplerate: 48000
avg byte/sec: 56000
Block align: 1
bits/sample: 0
cbSize: 0
==========================================================================
list_end=0x2286
AVI: dmlh found (size=248) (total_frames=1353)
list_end=0x22AA
hdr=Software  size=15
Software  : Nandub v1.0rc2
list_end=0xBFA370
Found movie at 0x280C - 0xBFA370
Reading INDEX block, 2693 chunks for 1353 frames (fpos=12559224).
AVI index offset: 0x2808 (movi=0x280C idx0=0x4 idx1=0x6D6C)
Auto-selected AVI audio ID = 1
Auto-selected AVI video ID = 0
AVI: Searching for audio stream (id:1)
AVI video size=9997642 (1353) audio size=2528150 (2528150)
VIDEO:  [XVID]  720x260  12bpp  29.970 fps  1771.6 kbps (216.3 kbyte/s)
Auto-selected AVI video ID = 0
Auto-selected AVI audio ID = 1
[V] filefmt:3  fourcc:0x44495658  size:720x260  fps:29.970  ftime:=0.0334
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
dec_audio: Allocating 1536000 + 131072 = 1667072 bytes for output buffer.
FFmpeg's libavcodec audio codec
libavcodec version 57.24.105 (internal)
Configuration: --enable-gpl --enable-postproc
INFO: libavcodec "ac3" init OK!
[ac3 @ 0000000001957b00]frame sync error
lavc_audio: error
AUDIO: 48000 Hz, 2 ch, floatle, 448.0 kbit/14.58% (ratio: 56000->384000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
WINSOCK2 init: 0
WINSOCK2 init: 0
[file] File size is 0 bytes
STREAM: [file] test05_1_dx50.avi
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
INFO: libavcodec init OK!
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Forcing output FourCC to 30355844 [DX50].
Building audio filter chain for 48000Hz/2ch/floatle -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 48000Hz/2ch/floatle
[dummy] Was reinitialized: 48000Hz/2ch/floatle
LAME 3.99.5 64bits (http://lame.sf.net)
CPU features: SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 17226 Hz - 17806 Hz

misc:

        scaling: 0.95
        ch0 (left) scaling: 1
        ch1 (right) scaling: 1
        huffman search: normal
        experimental Y=0
        ...

stream format:

        MPEG-1 Layer 3
        2 channel - joint stereo
        padding: off
        constant bitrate - CBR
        ...

psychoacoustic:

        using short blocks: channel coupled
        subblock gain: 1
        adjust masking: -2 dB
        adjust masking short: -2.2 dB
        quantization comparison: 9
         ^ comparison short blocks: 9
        noise shaping: 2
         ^ amplification: 0
         ^ stopping: 0
        ATH: using
         ^ type: 4
         ^ shape: 3.5 (only for type 4)
         ^ level adjustement: -5 dB
         ^ adjust type: 3
         ^ adjust sensitivity power: 1.000000
        experimental psy tunings by Naoki Shibata
           adjust masking bass=-0.5 dB, alto=-0.25 dB, treble=-0.025 dB, sfb21=0.5 dB
        using temporal masking effect: yes
        interchannel masking ratio: 0
        ...

MP3 audio selected.
Building audio filter chain for 48000Hz/2ch/floatle -> 48000Hz/2ch/s16le...
[dummy] Was reinitialized: 48000Hz/2ch/floatle
[libaf] Adding filter format
[format] Changing sample format from little-endian 32-bit float to little-endian 16-bit signed int
[format] Accelerated little-endian 32-bit float to little-endian 16-bit signed int conversion
[dummy] Was reinitialized: 48000Hz/2ch/floatle
[format] Changing sample format from little-endian 32-bit float to little-endian 16-bit signed int
[format] Accelerated little-endian 32-bit float to little-endian 16-bit signed int conversion
[libaf] Reallocating memory in module format, old len = 0, new len = 4361
Increasing filtered audio buffer size from 0 to 4352
XXX initial  v_pts=0.000  a_pos=28000 (0.500)
VDec: vo config request - 720 x 260 (preferred colorspace: Planar YV12)
Trying filter chain: expand lavc
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (720x260->720x260,flags=0,'MPlayer',0x32315659)
REQ: flags=0x401  req=0x0
videocodec: libavcodec (720x260 fourcc=30355844 [DX50])
Fontconfig failed to select a font. Trying without fontconfig...
get_path('subfont.ttf') -> 'C:/Users/Joshua/Desktop/mplayer-svn-37802-x86_64/mplayer/subfont.ttf'
Unicode font: 2993 glyphs.
Fontconfig failed to select a font. Trying without fontconfig...
get_path('subfont.ttf') -> 'C:/Users/Joshua/Desktop/mplayer-svn-37802-x86_64/mplayer/subfont.ttf'
Unicode font: 2993 glyphs.
*** [expand] Allocating mp_image_t, 768x288x12bpp YUV planar, 331776 bytes
VPos:   0.0s APos:   0.5s      1f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [0:0] A/Vms 0/16 D/B/S 0/1/0
*** [expand] Allocating mp_image_t, 768x288x12bpp YUV planar, 331776 bytes
[mpeg4 @ 0000000001957b00]Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream fi
lter without encoding but stream copy to fix it.
[ffmpeg] aspect_ratio: 2.769231
VDec: vo config request - 720 x 260 (preferred colorspace: Planar YV12)
Trying filter chain: expand lavc
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.77:1 - prescaling to correct movie aspect.
VO Config (720x260->720x260,flags=0,'MPlayer',0x32315659)
REQ: flags=0x401  req=0x0
*** [lavc] Allocating mp_image_t, 720x260x12bpp YUV planar, 280800 bytes
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
Muxer frame buffer sending 22 frame(s) to the muxer.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

1 duplicate frame(s)!
VPos:   0.0s APos:   0.5s      2f ( 0%)   0fps Trem:   0min   3mb  A-V:0.003 [0:0] A/Vms 0/23 D/B/S 1/1/0
*** [expand] Allocating mp_image_t, 768x288x12bpp YUV planar, 331776 bytes
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:   0.1s APos:   0.6s      3f ( 0%)   0fps Trem:   0min   2mb  A-V:0.007 [0:0] A/Vms 0/19 D/B/S 1/1/0
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:   0.1s APos:   0.6s      4f ( 1%)   0fps Trem:   0min   2mb  A-V:0.010 [0:0] A/Vms 0/16 D/B/S 1/1/0
[VD_FFMPEG] DRI failure.
*** [expand] Exporting mp_image_t, 720x260x12bpp YUV planar, 280800 bytes
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:   0.2s APos:   0.6s      5f ( 1%)   0fps Trem:   0min   2mb  A-V:0.013 [0:0] A/Vms 0/15 D/B/S 1/1/0
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:   0.2s APos:   0.7s      6f ( 1%)   0fps Trem:   0min   2mb  A-V:0.017 [0:0] A/Vms 0/14 D/B/S 1/1/0
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:   0.2s APos:   0.7s      7f ( 1%)   0fps Trem:   0min   2mb  A-V:0.020 [0:0] A/Vms 0/13 D/B/S 1/1/0
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:   0.3s APos:   0.7s      8f ( 1%)   0fps Trem:   0min   3mb  A-V:0.023 [0:0] A/Vms 0/12 D/B/S 1/1/0
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:   0.3s APos:   0.8s      9f ( 1%)   0fps Trem:   0min   3mb  A-V:0.027 [0:0] A/Vms 0/11 D/B/S 1/1/0
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set

............

VPos:  44.7s APos:  45.2s   1344f (100%) 106fps Trem:   0min   7mb  A-V:0.022 [1213:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:  44.8s APos:  45.2s   1345f (100%) 106fps Trem:   0min   7mb  A-V:0.019 [1213:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:  44.8s APos:  45.2s   1346f (100%) 106fps Trem:   0min   7mb  A-V:0.015 [1213:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:  44.8s APos:  45.2s   1347f (100%) 106fps Trem:   0min   7mb  A-V:0.012 [1213:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:  44.9s APos:  45.2s   1348f (100%) 106fps Trem:   0min   7mb  A-V:0.009 [1213:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:  44.9s APos:  45.2s   1349f (100%) 106fps Trem:   0min   7mb  A-V:0.005 [1213:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:  44.9s APos:  45.2s   1350f (100%) 106fps Trem:   0min   7mb  A-V:0.002 [1213:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:  45.0s APos:  45.2s   1351f (100%) 106fps Trem:   0min   7mb  A-V:-0.001 [1212:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:  45.0s APos:  45.2s   1352f (100%) 106fps Trem:   0min   7mb  A-V:-0.005 [1212:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
[libxvid @ 0000000001957b00]AVFrame.format is not set
[libxvid @ 0000000001957b00]AVFrame.width or height is not set
VPos:  45.0s APos:  45.2s   1353f (100%) 106fps Trem:   0min   7mb  A-V:-0.008 [1212:160] A/Vms 0/6 D/B/S 1/4/3
ds_fill_buffer: EOF reached (stream: audio)
ds_fill_buffer: EOF reached (stream: video)

Skipping frame!
VPos:  45.0s APos:  45.2s   1354f (100%) 106fps Trem:   0min   7mb  A-V:-0.011 [1212:160] A/Vms 0/6 D/B/S 1/5/4

Flushing video frames.


CBR audio: 20000 bytes/sec, 480 bytes/block
Writing index...
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

Video stream: 1212.483 kbit/s  (151560 B/s)  size: 6827021 bytes  45.045 secs  1354 frames

Audio stream:  160.000 kbit/s  (20000 B/s)  size: 903840 bytes  45.192 secs
Uninit audio filters...
[libaf] Removing filter dummy
[libaf] Removing filter format
Uninit audio: ffmpeg
Uninit video: ffmpeg
Assertion v>0 && v<=(1 ? 32 : 16) failed at libavutil/mem.c:233

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Version 0, edited 9 years ago by redxii (next)

comment:3 by reimar, 9 years ago

Resolution: fixed
Status: newclosed

It's reproducible on Linux if forcing the MEMALIGN_HACK.
Fixed now, along with a few more annoying issues (like those format/width/height not set prints).

Note: See TracTickets for help on using tickets.