History

wma: Clip WMA1 and WMA2 frame length to 11 bits.

The MDCT buffers in the decoder are only sized for up to 11 bits. The reverse engineered documentation for WMA1/2 headers say that that for all samplerates above 32kHz 11 bits are used. 12 and 13 bit support were added for WMAPro. I was unable to make any Microsoft tools generate a test file at a samplerate above 48kHz. Discovered by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Alex Converse committed 14 years ago

Commit d78bb1a1 parent 9f9c45f1 file · +1 −1Browse files

Unified · Split

libavcodec/wma.c+1−1
@@ -85,7 +85,7 @@ int av_cold ff_wma_get_frame_len_bits(int sample_rate, int version, · 84 unmodified lines
8585 } else if (sample_rate <= 22050 ||
8686 (sample_rate <= 32000 && version == 1)) {
8787 frame_len_bits = 10;
88− } else if (sample_rate <= 48000) {
88+ } else if (sample_rate <= 48000 || version < 3) {
8989 frame_len_bits = 11;
9090 } else if (sample_rate <= 96000) {
9191 frame_len_bits = 12;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t