Commit graph

44 commits

Author SHA1 Message Date
ShashankPathmudi
12e2e71b24
Fix for Heap-buffer-overflow in Codec__decodeXAACStream (#85)
These changes fix the Heap-buffer-overflow in Codec__decodeXAACStream runtime error
caused due to unsupported frame length type configuration for LATM streams.

Bug: ossFuzz:67767
Test: poc in bug
2024-04-16 17:58:40 +05:30
Shashank Pathmudi
2624ae15b4 Fix for Heap-buffer-overflow WRITE 8 in ixheaacd_init_sbr
These changes handle the Heap-buffer-overflow WRITE 8 runtime error reported
due to unsupported channel configuration for USAC.

Bug: ossFuzz:64960
Test: poc in bug
2023-12-18 16:20:32 +05:30
Nikhil Bhavikatti
ae104f0711 Restructuring of Decoder 2023-05-15 17:23:01 +05:30
Shashank Pathmudi
6ce7dc469c Error concealment support for xHEAAC decoder 2023-02-28 11:54:07 +05:30
Shashank Pathmudi
b9e8ada604 MPS support for xHEAAC decoder 2023-01-23 14:46:59 +05:30
Nikhil Bhavikatti
3accfa6001 Error robustness tool addition for xHEAAC decoder 2022-11-29 11:48:54 +05:30
Nikhil Bhavikatti
42a0d6d68c Transform length 960 support for xHEAAC decoder 2022-11-29 11:47:23 +05:30
Sowmya Sree Reddy G
270720de5e ELDv2 support for EXHEAAC decoder 2022-10-10 10:15:43 +05:30
Nikhil Bhavikatti
1fb7d08581 Fix for OOB issue
Frame length was not getting updated before DRC processing. Moved the
update to appropriate location.
2022-09-27 15:46:51 +05:30
Nikhil Bhavikatti
22071e3e10 Fix for OOB issue in DRC
Frame length was not getting updated before DRC processing. Moved the
update to appropriate location.
2022-09-09 13:33:34 +05:30
Rajat Kumar
c9614b8df9 Fix for write null dereferencing in AAC frame decode
Audio Object type(AOT) should be same across init and
execute calls. This check was missing when AOT is
not SBR and PS and hence added as fix for this bug.
For AOTs, SBR and PS since this value is re-read at
a later point, check already present would be fine.

Bug: 196308693
Test: poc in bug
2022-07-27 14:26:18 +05:30
Rajat Kumar
2f905017d6 Fix for NPD in ixheaacd_init_sbr
Added check for AOT(read from bit stream) mismatch,
between two consecutive execute calls while decoding
LATM header.

Bug: 168429291
Test: poc in bug

Change-Id: I64b3e38c97499b1103c9cc5594742b804e0a3965
2020-09-29 18:11:57 +05:30
Rajat Kumar
a741e1d5de Fix for Null-dereference read in ixheaacd_init_sbr
Header decode is done with AOT 2 (AAC-LC profile),
but due to corrupted nature of input file AOT is read
as 42 (USAC profile) after few memory/table initializations.

As fix, modified the check to prevent an attempt
to change AOT in mid file.

Bug: 160389683
Test: poc in bug

Change-Id: Id95aa74b0833321b29b602d97b14c5a5580ef7fc
2020-09-11 21:41:49 +05:30
Rajat Kumar
bcbd383251 Fix to handle missing checks on error returned
Added missing return checks and converted
functions to void which doesn't return anything
other than zero.

Test: Review
Test: atest android.media.cts.DecoderTest
Bug:131183694

Change-Id: Iea7bb9959fffd7a0e4f345f86581a1328e04a38e
Merged-In: Iea7bb9959fffd7a0e4f345f86581a1328e04a38e
2020-09-10 12:48:42 -07:00
Rajat Kumar
57b4f3eac4 Fix for OOB in external libxaac
Codec initialization is done with AOT 2 (AAC-LC profile),
but AOT changes abruptly to 42 (USAC profile) in execution
leading to access of uninitialized tables. Hence Added a
check for mismatch in AOT during initialization and
AOT during execution.

Bug:150400335
Test: poc in bug

Change-Id: I73ca2bf0f963df7982c1a8371a8fc0c2e3c7cd82
2020-03-29 17:16:45 -07:00
Tripti Tiwari
3bb1d13705 Fix for heap-buffer-overflow in ixheaacd_read_bits_buf.
During bitbuffer search for sync word, the buffer is incremented each
time in the loop. However, in the second initialization, this size
is not taken care of.
As a fix, reduced the size appropriately in the second init.

Bug:145727847
Test:poc in bug

Change-Id: Id1079d2feeba6841675562e0e1f7b7983acd1b35
2020-01-11 17:27:28 -08:00
Ramesh Katuri
ce7b4e93ce Fix for correcting #include delimiters
This CL contains changes to make #include delimiters stying
consistent. For all system files inclusion we will use <> and
all user files we will use ""

Bug: 125443111
Test: compilation
Change-Id: Ie5f609b9bef8357877affb7f48d46df7c387d142
2019-08-26 13:35:44 -07:00
Sushanth Patil
8f97584285 Fix for array out of bound in ixheaacd_dec_execute
Decode init fatal error was not handled at upper level in
ixheaacd_common_lpfuncs.c. Hence, corresponding check has
been added.

Bug:126154782
Test: poc
Change-Id: I5332f5fd0260110f426cfe176e6d64f5989cfb08
2019-03-21 15:21:51 -07:00
Rajat Kumar
8913b0b126 Fix for global buffer overflow in scale factor process function
Bug: 112709994
Test: vendor
Change-Id: Ic201888327c62374a8fcb2b293ac47cd401fede4
2019-02-08 22:22:41 +00:00
TreeHugger Robot
4d7d9daad6 Merge "Fix for array bound overflows" 2019-01-28 19:15:34 +00:00
Rajat Kumar
eb58cff832 Fix for array bound overflows
Added bound checks and handled the respective returned
error across source and header files.

Bug:120452956
Test: vendor, poc
Change-Id: I5a9ebf68e7a5d2f41a0112aff113f0b1b8eeba7c
2019-01-11 14:16:39 -08:00
Ramesh Katuri
5017b03aeb Fix for crash in ixheaacd_ga_hdr_dec
Bug:117049088
Test: vendor
Change-Id: I2b64b5c60eaf037ab2ff23c9edef2ddd7064fb8e
2019-01-11 10:26:12 -08:00
TreeHugger Robot
f6bf43db8f Merge "Fix for crash in ixheaacd_decode_init" 2019-01-07 18:22:03 +00:00
TreeHugger Robot
c7e444dad2 Merge "Fix for parsing erroneous Program Config Element" 2019-01-05 01:13:39 +00:00
Ray Essick
7ead99042a Merge "Bit buffer error handling using setjmp and longjmp" 2019-01-04 23:12:23 +00:00
TreeHugger Robot
98b3146396 Merge "Fix for uninitialized bit buffer variables" 2019-01-04 02:00:36 +00:00
Ramesh Katuri
e862c5ddc5 Fix for uninitialized bit buffer variables
Bug:118355146
Test: vendor
Change-Id: I22c5019989036354360687265c758fd86fa26ddc
2019-01-03 15:46:18 -08:00
Ramesh Katuri
e988b01822 Bit buffer error handling using setjmp and longjmp
Bug: 112552816
Bug: 116774502
Bug: 117531281
Bug: 118145923
Bug: 120124041
Test: vendor
Change-Id: Ib11c82a8cf728c8a0a841b5fc0452daa1a5b37be
2019-01-02 14:08:58 -08:00
Ramesh Katuri
015d135f65 Fix for stack buffer overflow in ixheaacd_latm_stream_mux_config am: 2e513342a1
am: f4b31cc0cf

Change-Id: I625b419eeca9a88d0e9d7eff4d03450fa6bb8cea
2019-01-02 12:08:35 -08:00
TreeHugger Robot
e6d51f6bf3 Merge "Fix for files with unsupported AOT in the first frame" 2018-12-29 14:44:12 +00:00
Ramesh Katuri
2e513342a1 Fix for stack buffer overflow in ixheaacd_latm_stream_mux_config
Bug:118149009
Test: vendor
Change-Id: I16213a2db36e9d678f7105edda9a4a6c17a3f8a6
2018-12-21 10:27:29 -08:00
Ramesh Katuri
c0ead4ba18 Fix for heap buffer overflow in dec data init function
Bug:117935831
Test: vendor + poc
Change-Id: Iede9bd265eebbefda39c3328a5367399e6ace963
2018-11-25 15:36:26 -08:00
Ramesh Katuri
9a89ef5bbc Fix for crash in ixheaacd_decode_init
Sampling frequency of the input stream is read from the bit stream.
As per spec there are 30 standard sampling frequencies.Sampling frequency
index which is a 5 bit filed read from the bit stream. If the input
stream has sampling frequency other than this 30 then sampling index
from the bit stream will be 0x1f. If the sampling frequency index is 0x1f
then sampling frequency is directly read from the bit stream (24 bit).
Even though sampling frequency can be any value between ( 0 and 2^24-1)
as per usac specification this free sampling frequency has to be clamped.
We implemented that clamping as part of this CL.

Bug:117047049
Test: poc + vendor
Change-Id: I5793139521563e5efd03c8ed9cf5aeda0792bef2
2018-11-14 11:55:32 -08:00
Ramesh Katuri
2b392aa445 Fix for files with unsupported AOT in the first frame
Bug:116474127
Test: vendor
Change-Id: I2e590168792d555f32c2614fe1e4f8f20ba57343
2018-10-20 07:56:24 -07:00
Ramesh Katuri
be24fb5180 Fix for un-initialized adts header in header decode
adts header structure has been initialized to zero

Bug:113035086
Test: manual
Change-Id: Ifa7d6332899e5a44bb1e818ba1dd92f169c5eb70
2018-09-25 14:36:34 -07:00
Ramesh Katuri
33d73e6032 Fix for parsing erroneous Program Config Element
Input stream contains an erroneous PCE. While parsing
PCE error code was not handled properly,because of this
number of channels are updated with wrong value.

Internal buffers are accessed using number of channels
as array index,because of wrong number of channels
NULL pointer is getting deferred

Bug: 112715634
Test: poc
Change-Id: I3e3d30fed737d62f52f2757b547fe26f1c9c06da
2018-09-25 12:48:32 -07:00
Ramesh Katuri
9b9fac25dc Merge "Fix for heap buffer overflow in xaac decoder init" into pi-dev am: 1ef552efbb
am: 5457a1a10b

Change-Id: Iadf7659ac3b662c34a6d69ad6346be02d2e05047
2018-09-05 21:24:14 -07:00
Ramesh Katuri
4878ef09c7 Fix for heap buffer overflow in xaac decoder init
Number of elements allowed in usac profile are 16. Erroneous input
stream in this use case has 63336 elements.We have an error
check for this max number of elements while parsing the decoder
configuration.This returned error code was not handled properly.

Maximum 16 config elements can be used while codec creation,because
of number of elements values is coming as 63336, during
creation time OOB read is happening.

Bug:112766520
Bug:112857468
Bug:112913145
Bug:112918261
Test: re-ran poc
Change-Id: If9413546371f72a6896f5c7e7d22a314e484cf76
2018-09-05 14:50:05 -07:00
Ramesh Katuri
0ba12cd042 Fix for segmentation fault in xaac decoder execute
Code was modified to handle both fatal and nonfatal errors.
Initially non fatal errors from general audio header decode
were ignored because of which there is segmentation fault
occurring while accessing channel info during execute call

Bug:112552509
Test: poc
Change-Id: I39bc9513ed9e408bc43d9e3746d221852f2aa4f9
2018-09-04 11:49:00 -07:00
Harish Mahendrakar
dca80eae32 Changes based on review comments
Test: CTS android.media.cts.DecoderTest

Formatting changes in test folder

Bug: 80493357
Change-Id: Iaa9521521b2278b78ba789d026360a8b2eb9b54c

Changes based on the received review comments

Bug: 109679313
Change-Id: I9cd35ab4fb131f12a8970e772f464d44519496b9
2018-07-03 11:21:47 -07:00
Ramesh Katuri
b3226ce6f8 Formatting changes
Formatting .c and .h files using clang-format
Formatting .s files

Bug: 80493357
Test: compare object sizes
Change-Id: I38296083c9d2d566a6a2564db2e391e4b2bd43a9
2018-06-07 16:52:19 -07:00
Harish Mahendrakar
8eb646f89b Collected Cleanups from Ittiam
Test: CTS android.media.cts.DecoderTest{AacDrc,XheAac}

Added __ARM_NEON__ check to generic function selector

Bug: 80432407
Change-Id: I66c7879fda1369da88ccaea5f8792ea54657cdaf

Added support to build for mips

Bug: 80432286
Change-Id: I908029bbaddd3c1fbc39be1192926b56d981576e

Add optimized versions for qmf_dec for armv7 and armv8

Separating common functions and platform specific functions
in ixheaacd_qmf_dec.c. Platform specific functions are moved
to qmf_dec in armv7, armv8 and generic folder.

Bug: 80431870
Change-Id: I860cb79a1870e228d2108b7915418e1c003cefc5

Fixes for crashes reported by Fuzzer tool

Bug: 109697676
Change-Id: I862fc054b99ee9d427d20596bc8d2e85522a7188
2018-06-05 13:04:22 -07:00
Ray Essick
4908247643 Sanitization fixes from new CTS tests
Updates from vendor to remedy issues exposed by new CTS tests

Bug: 77287124
Test: CTS DecoderTest, DecoderTest{AacDrc,XheAac}

@ Sanitizer fixes in libxaac

Fixes few integer overflow sanitizer errors
Progagate few errors
ENABLE_DRC macro is removed
AMMENDMENT1 macro is removed

Change-Id: Ic61163dfd6318bd4a00ed45e1295c819cb0f637b

@ Add support for audio pre-roll and DRC effect type

Also includes the following
MPEG-D DRC parameters related changes
USAC config switch changes
SBR config switch changes

Bug: 80133175
Change-Id: I0ab25641768cf523b66f7b0fcb4137429c1c4a77

@ Fixed trailing spaces

Change-Id: I32de0c9d3f7237e1fbf8dfef1cac485ef8458173

@ Replaced tabs

Change-Id: Ic741ee13d7b978b37edc27d087903caaa40b8d90
2018-05-25 11:35:52 -07:00
Ray Essick
51aa06e124 Bring xHE-AAC into pi-dev branch
bring the multi-commit integration from master to pi-dev

libxaac multi-arch cleanup

Change-Id: Ibcefa14f439e75f48a54955c9abf1a06c418e41e
Change-Id: Ia7a9b1e4de0add847c136f6f545b81dc8087521d
Change-Id: I12c3f8414dc9971017de223e88f292f8982a5c9b

Fix dependency error in Android.bp
Change-Id: Ic54f688736b3f2a70172676e4cee22aea4cbd705

Localized Android.bp
Change-Id: I68c4fc24fca279104c8ce2129fd4a3ed8d116b9b

Import xHE-AAC decoder from Ittiam
Change-Id: I3c8d124033f967b29d6e384cce5c843ee17a7bb1

Bug: 77287124
Test: build, cts DecoderTest
2018-05-17 14:36:48 -07:00