1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-02-04 01:37:50 +01:00

288 Commits

Author SHA1 Message Date
ezicomezigo
89aeea5f29 Fix SBR multichannel noise
for 5.1 ch, the channel elements are as follows: SCE - CPE - CPE - LFE
and the channel-mapping table for 5.1 ch is :
{ 2, 0, 1, 4, 5, 3,255,255}, /* 5.1ch */

For the last LFE channel, sbr decoder returns error, SBRDEC_UNSUPPORTED_CONFIG;
2017-12-20 18:25:56 +09:00
Martin Storsjo
1b0cec288c Fix an assertion failure when encoding a particular input at specific bitrates 2017-12-20 10:21:34 +02:00
Martin Storsjo
56c717e223 Avoid reading out of bounds due to too large aaIidIndexMapped
Fixes: 4151/clusterfuzz-testcase-4854089193095168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-11-20 12:36:46 +02:00
Martin Storsjo
1e3515e03e Fix an assertion failure (avoid division by zero) when encoding a particular input 2017-10-30 23:06:44 +02:00
Martin Storsjo
cf697df5ad Avoid reading out of bounds due to negative aaIccIndexMapped
Fixes: 3452/clusterfuzz-testcase-4898065225875456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-10-20 16:33:25 +03:00
Martin Storsjo
c366b3db8f Add tighter sanity checks in CBlock_GetEscape
We can't read 31 bits of value here, since that would place the
topmost bit in the sign bit.

Fixes: 3480/clusterfuzz-testcase-4573445423628288

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-10-20 16:33:25 +03:00
Doug Benedict
e2e35b8273 Make sure there are enough bits when reading ADTS header. 2017-09-20 14:30:42 -07:00
Martin Storsjo
a3d1168943 Adjust the fix for infinite loops with a drained ADTS stream
This should have less risk of causing other issues.
2017-08-18 22:38:09 +03:00
Martin Storsjo
963b189156 Enhance TNS tuning for 8 kHz audio sampling rate
This tuning has been suggested by Fraunhofer, fixing overflows
in encoding certain sequences.
2017-08-18 22:36:48 +03:00
Martin Storsjo
1244b257ee Always feed more input data when possible for ADTS
This fixes cases where an ADTS header could set numberOfRawDataBlocks
to a number larger than 1, which would lead to transportDec_FillData
not feeding any more data, even though the input buffer was depleted.

Fixes: 3014/clusterfuzz-testcase-5425740193464320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-08-15 23:12:51 +03:00
Martin Storsjo
393a86c0db Check that pSettings is initialized
Fixes: 2872/clusterfuzz-testcminimized-4529959869612032

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-08-15 23:12:51 +03:00
Martin Storsjo
ee6d9476a6 Check for heightLayer out of range
Alternatively, the bits read in CProgramConfig_ReadHeightExt could
be checked right there instead.

Fixes: 2802/clusterfuzz-testcase-minimized-6752357788418048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-08-03 14:22:30 +03:00
Martin Storsjo
52c2660c26 Make sure at least one bit exists before reading further in FDKreadBit
Fixes: 2709/clusterfuzz-testcase-minimized-6160249369133056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-08-03 14:22:30 +03:00
Martin Storsjo
ecb2ad9a7b Check that all channel mapping entries used are valid
If channel numbers are changed on the fly (in invalid bitstreams),
we can end up with a channel mapping with fewer channels mapped
than we actually try to output.

Ideally, this condition should probably be checked somewhere
closer to where it enters such a state, not when using the
channel mapping though.

Fixes: 2808/clusterfuzz-testcase-minimized-4694952892170240
Fixes: 2275/clusterfuzz-testcase-minimized-6205444085252096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-08-03 14:22:04 +03:00
Martin Storsjo
af5863a78e Re-fix "Stack-buffer-overflow in FDKmemset"
This probably doesn't fix the root cause, but at least fixes
the issues found in this particular fuzzed sample.

Compared to the previous fix in 39e13c1acbca94f562f9776e1555ced50dd0dfcd,
this doesn't break HE-AACv2 encoding, by allowing the case with
usb==no_channels.

Fixes: 1973/clusterfuzz-testcase-minimized-6319232084082688

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-06-22 12:32:55 +03:00
Martin Storsjo
a9c8cb2cf6 Revert "Fix "Stack-buffer-overflow in FDKmemset""
This reverts commit 39e13c1acbca94f562f9776e1555ced50dd0dfcd.

This turned out to break HE-AACv2 encoding. Will look for a better
fix for the issue found by the fuzzed sample.

This fixes issue #69.
2017-06-22 11:54:29 +03:00
Martin Storsjo
e7f36eed22 Check that the SBR decoder has been properly initialized
This probably doesn't fix the root cause, but at least fixes
the issues found in this particular fuzzed sample.

Fixes: 1994/clusterfuzz-testcase-minimized-6368089497141248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-06-12 23:44:59 +03:00
Martin Storsjo
39e13c1acb Fix "Stack-buffer-overflow in FDKmemset"
This probably doesn't fix the root cause, but at least fixes
the issues found in this particular fuzzed sample.

Fixes: 1973/clusterfuzz-testcase-minimized-6319232084082688

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-06-12 23:44:59 +03:00
Martin Storsjo
d2fa9750d5 Make sure to end all CRC regions in the right order
This fixes assert failures, when a (corrupt/fuzzed) bitstream
doesn't trigger starting/ending CRCs properly (or when decoding
is aborted halfway when an error is encountered). Skipping ending
a CRC region doesn't trigger an assert failure, but when a later
CRC region is started and ended, an assert fails when the end
doesn't match the expected CRC region.

Fixes: 1928/clusterfuzz-testcase-minimized-6480505958563840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-06-12 23:44:43 +03:00
Martin Storsjo
21cb19455c Don't try to read a negative number of bits
Fixes: 1919/clusterfuzz-testcase-minimized-5021082513833984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-06-12 23:44:43 +03:00
Martin Storsjo
4c4da0e39a Avoid infinite loops in block decoding
Fixes: 1921/clusterfuzz-testcase-minimized-5480510065213440

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2017-06-12 23:44:43 +03:00
Martin Storsjo
50922e3dbd Try to properly handle the case when the bitstream reader runs out of bits to read 2017-04-26 23:37:11 +03:00
Robert Kausch
6b0d8201b1 Add checks to avoid overreading supplied buffers and fix issue #61. 2017-04-23 21:31:36 +02:00
Martin Storsjo
5eb6f0db8c Saturate additions in spectralChange
This fixes a crash.
2017-03-14 14:37:55 +02:00
Martin Storsjo
32c712cbd1 Merge remote-tracking branch 'aosp/master' 2017-03-14 14:37:45 +02:00
Treehugger Robot
b0af861f5a Merge "Fix not properly handled NULL-pointer access before check in aac lib" 2017-02-23 21:25:44 +00:00
liuchao
64bd48e21b Fix not properly handled NULL-pointer access before check in aac lib
1) Fixes some potential NULL-pointer access in case input pointer is
passed NULL
2) Modified some for lazy init

Test: mm -j 8
Change-Id: I7fca97e1d9f70d8e8c1533b519181af35a5468f7
2017-02-23 14:22:01 +08:00
Treehugger Robot
b82c85d0b1 Merge "Linux compilation fix" 2017-02-21 20:48:23 +00:00
Jakub Pawlowski
2cd9fe3964 Linux compilation fix
Test: manual
Change-Id: Ie374e47b93e8fa3a44c731cb73f7e151d265c74c
2017-02-21 10:43:02 -08:00
Treehugger Robot
8334e4b410 Merge "Change build config of aac from Android.mk to Android.bp" 2017-01-20 01:50:48 +00:00
Pavlin Radoslavov
6cc0003b74 Change build config of aac from Android.mk to Android.bp
* In an effort to modernize build configurations to the new Soong
  system, we need to upgrade existing Android.mk files to Android.bp
* This file is done by using the following steps:
  1. Manually removing all *_sources from Android.mk, because
     of the unusual make logic they use
  2. Running the auto-conversion tool:
     androidmk Android.mk > Android.bp
  3. Editing the result Android.bp:
     3.1. Writing the "srcs" list
     3.2. Removing the escaping around -Wno-#warnings in cflags,
          because those are not needed anymore
     3.3. Renamed local_include_dirs to export_include_dirs to
          facilititate the inclusion of header files.
          It appears users of libFraunhoferAAC are using header
          files from all include directories, hence the renaming.

Test: Code compilation ("mm" in external/aac, and "make" in top-directory)
Bug: b/32958753 b/34454142
Change-Id: Ie89f73722908e8734f4b88f1407952311ec064af
2017-01-19 13:10:11 -08:00
Martin Storsjo
74c1a2a4f8 Update the changelog for the upcoming 0.1.5 release v0.1.5 2017-01-11 10:45:23 +02:00
Martin Storsjo
bf64cd3964 Merge remote-tracking branch 'aosp/master' 2017-01-04 08:49:09 +02:00
Martin Storsjo
5fd7e6537d Merge remote-tracking branch 'aosp/master' 2016-10-28 10:26:20 +03:00
Martin Storsjo
664e5f2794 Merge "Remove redundant register storage class specifiers"
am: ed91226cec

Change-Id: Ieb0f6090190d7cd2d21599f9b1e6ce950608313d
2016-10-28 01:14:27 +00:00
Treehugger Robot
ed91226cec Merge "Remove redundant register storage class specifiers" 2016-10-28 01:08:50 +00:00
Martin Storsjo
6ec082c6c3 Remove redundant register storage class specifiers
Clang warns about this being deprecated, when building without specifying
-std=c++98.

This doesn't give any measurable encoding speed impact on ARM or AArch64,
on neither GCC nor Clang.

Change-Id: I63a0bbd1dccb97547522da188ee585d4d8127c29
2016-10-18 09:22:55 +03:00
Martin Storsjo
2b1e8db04d Don't force C++98 mode any longer
The code builds fine in C++11 mode now.
2016-10-18 08:29:04 +03:00
Martin Storsjo
55554d0b2d Merge remote-tracking branch 'aosp/master' 2016-10-18 08:28:51 +03:00
Martin Storsjo
515fb25ef7 Merge "Add casts to avoid errors due to narrowing"
am: 4556cb9cb8

Change-Id: I4cb4a7dace03c7c09403588da05ea8df0f35077e
2016-10-18 03:12:10 +00:00
Treehugger Robot
4556cb9cb8 Merge "Add casts to avoid errors due to narrowing" 2016-10-18 03:05:51 +00:00
Martin Storsjo
6d7d5013ea Add casts to avoid errors due to narrowing
This fixes building in C++11 mode, which normally errors out
on narrowing hex literals to signed long.

This is similar to what was done in git commit ef30836651
(change id I64d19a8a8059c5a96386b1eaac297fd2469515f8), completing
the fix for that category of issues.

Change-Id: I1907bc947d43bf44910fb2b34bf2b31c0e53aa53
2016-10-17 10:32:24 +03:00
Martin Storsjo
cb57d89522 Add new files to "make dist" 2016-09-24 13:36:43 +03:00
Martin Storsjo
72037da0ba Fix building with MSVC for ARM
cmnintrin.h only existed for Windows CE, and doesn't seem to actually
be necessary for building this.
2016-09-11 13:28:47 +03:00
Martin Storsjo
45915b67e4 Detect MSVC x64 2016-09-11 13:28:44 +03:00
opcodevoid
6ac0611b07 Windows MSVC Makefile 2016-09-11 13:28:30 +03:00
Martin Storsjo
5eb3c9be88 Merge remote-tracking branch 'aosp/master' 2016-09-10 14:38:15 +03:00
Lexyan
1d686c3a23 Add aarch64 assembly optimization (ARMv8a 64 bits)
The fixmuldiv functions don't need inline assembly to be fast
in this architecture; the compiler (both clang and GCC) figure
out to use the optimal instructions for this (which is 2 instruction
sequence), and when letting the compiler emit the instructions
instead of using inline assembly, the compiler is able to
interleave those instructions with other instructions,
improving scheduling, making it even faster than when using
inline assembly.

Overall, this gives about 50% speedup.
2016-09-10 14:33:39 +03:00
Jean-Michel Trivi
ca6ae4ffe4 Merge "Avoid a warning about extra parentheses" am: f935254cc9 am: 899335d310
am: 79c3cd8b1a

Change-Id: Ia7a3b896268f11c5c2003c36aa38724910b08db0
2016-09-09 22:18:35 +00:00
Jean-Michel Trivi
79c3cd8b1a Merge "Avoid a warning about extra parentheses" am: f935254cc9
am: 899335d310

Change-Id: Iff4192d216e3ebeed98bf37d76b892be391ffa02
2016-09-09 22:16:04 +00:00