Commit Graph

347 Commits

Author SHA1 Message Date
Martin Storsjo 8e4df05119 Change aac-dec.c to decode LOAS 2018-07-07 00:26:03 +03:00
Martin Storsjo a811fd41b5 Convert aac-dec.c to feed bytes blindly 2018-07-07 00:09:07 +03:00
Martin Storsjo 08a821d188 Increase the output buffer size in aac-dec.c as well
Even though one can't have HE-AAC in ADTS, increase the size here
as well for consistency.
2018-07-05 22:57:03 +03:00
Martin Storsjo 3a81d6ae68 Increase the output buffer size for HE-AAC 2018-07-05 00:29:50 +03:00
Martin Storsjo 8484697c4b Set AVFMT_FLAG_KEEP_SIDE_DATA when demuxing m4a, if the demuxer migth need it 2018-07-05 00:02:56 +03:00
Martin Storsjo f4da0776b4 Fix the aacDecoder_DecodeFrame call in m4a-dec.c
On errors, this function clears the output buffer, and the buffer
size provided is in number of samples, not number of bytes.
2018-06-29 15:01:12 +03:00
Martin Storsjo d61932a908 Fix the aacDecoder_DecodeFrame call in aac-dec.c
On errors, this function clears the output buffer, and the buffer
size provided is in number of samples, not number of bytes.
2018-06-29 15:00:32 +03:00
Martin Storsjo 1d9346e267 Add a decoding example that uses libavformat to demux .m4a files 2018-06-22 23:47:19 +03:00
Martin Storsjo c4394bc807 Add an example of decoding from an ADTS file 2018-06-22 23:47:19 +03:00
Martin Storsjo 7331284bc8 Add wav writer functions, for use with a decoder example 2018-06-22 23:47:19 +03:00
Martin Storsjo a50eecf65b Fix overflows in accumulation, fixing crashes
This fixes github issue #83.
2018-05-04 12:47:17 +03:00
Martin Storsjo a30bfced6b Bump the versions and add a changelog entry for v0.1.6 2018-03-06 12:49:28 +02:00
Martin Storsjo 5891b75b31 Fix warnings with MSVC about mismatch between signed and unsigned in a header 2018-03-06 12:49:20 +02:00
Martin Storsjo 54da05eb39 Update the list of extra files for "make dist" 2018-03-06 12:29:53 +02:00
Martin Storsjo 29979abe7d Merge remote-tracking branch 'aosp/master' 2018-03-06 12:20:17 +02:00
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
Xin Li a3e0aa5f25 Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:28 +00:00
Xin Li ea031590ac DO NOT MERGE: Merge Oreo MR1 into master
Exempt-From-Owner-Approval: Changes already landed internally
Change-Id: I66dea07398b42d99d5d1373dbbc6d28752c04193
2017-12-06 14:24:45 -08: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
Chih-Hung Hsieh 858c2a7c6e Merge "Use -Werror in external/aac" am: f38aee2252 am: 82440fab16
am: 5a1868a64f

Change-Id: I4beb4b05f00077e1c7cbcc5ae197001c6251af09
2017-10-07 00:50:14 +00:00
Chih-Hung Hsieh 5a1868a64f Merge "Use -Werror in external/aac" am: f38aee2252
am: 82440fab16

Change-Id: I3cee76ab540b54b4ef6d6bdb891fc53fd0ec562d
2017-10-07 00:47:44 +00:00
Chih-Hung Hsieh 82440fab16 Merge "Use -Werror in external/aac"
am: f38aee2252

Change-Id: I65c18c6eb45de16da43e862068929e9a9695caf7
2017-10-07 00:45:22 +00:00
Treehugger Robot f38aee2252 Merge "Use -Werror in external/aac" 2017-10-07 00:39:23 +00:00
Chih-Hung Hsieh 3e8a17c1c1 Use -Werror in external/aac
Bug: 66996870
Test: build with WITH_TIDY=1
Exempt-From-Owner-Approval: Colin +2 should be the owner approval
Change-Id: I167f73ee9dc5e977fd6976f48732ae1e1fe13c8b
2017-10-06 21:52:25 +00: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
Jiyong Park 82b9d6795a Make software codecs as VNDK
am: a4aa860efb

Change-Id: I662a0675e67bd421b2b3c02391c25cf38f39d84f
2017-08-10 01:18:58 +00:00
Jiyong Park a4aa860efb Make software codecs as VNDK
Software codecs and their dependencies are marked as VNDK (or just
vendor_available:true for static/header libs).

Bug: 37343418
Test: build the software codecs with BOARD_VNDK_VERSION=current

Change-Id: I9ecedb5a95abc9978ff7ed3538bd2dedec750c7d
2017-08-07 13:12:12 +09: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 39e13c1acb,
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 39e13c1acb.

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
Chih-Hung Hsieh afe3b88936 Merge "Add OWNERS in external/aac" am: db59691026 am: 6f8a59ff40 am: e10e3d33cf
am: 32b8bd3dc9

Change-Id: Icbfbce61951a55c3cfa106bdf0bb7f84da2ca453
2017-06-05 19:47:38 +00:00
Chih-Hung Hsieh 32b8bd3dc9 Merge "Add OWNERS in external/aac" am: db59691026 am: 6f8a59ff40
am: e10e3d33cf

Change-Id: I3b51a11cc119ebc35aab051c21133a1476db5a0a
2017-06-05 19:40:31 +00:00
Chih-Hung Hsieh e10e3d33cf Merge "Add OWNERS in external/aac" am: db59691026
am: 6f8a59ff40

Change-Id: I236f2028ad5ae6e14ee0655456d4d42b785bdc45
2017-06-05 19:35:00 +00:00
Chih-Hung Hsieh 6f8a59ff40 Merge "Add OWNERS in external/aac"
am: db59691026

Change-Id: Id365d26e05abceec99ddac2e727483d4b294d63d
2017-06-05 19:30:30 +00:00
Treehugger Robot db59691026 Merge "Add OWNERS in external/aac" 2017-06-05 19:19:38 +00:00