Commit Graph

174 Commits

Author SHA1 Message Date
Fraunhofer IIS FDK 2d292e9b2d Use SATURATE_LEFT_SHIFT in get_lsppol() to prevent integer overflow.
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ie9ec52485a52b076a900b111b035289110c004f8
2019-10-15 15:49:00 -07:00
Fraunhofer IIS FDK 4c839c6a90 Fix integer overflow in E_UTIL_preemph().
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Iaaa0630e59d8e83e58b25168a3db04304485429b
2019-10-15 15:48:46 -07:00
Fraunhofer IIS FDK 1b4a3bedbb Overcome potential integer overflows in M/S module for complex prediction.
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ic0648203b6a61ebff8bcc93c4b1099e033bc6860
2019-10-15 15:48:32 -07:00
Fraunhofer IIS FDK 40d2a1d8b0 Avoid integer overflows with pseudoLR in CAacDecoder_DecodeFrame().
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I5c83d72b5c0f4cd1569b648f102c8c549a7a6ac2
2019-10-15 15:47:53 -07:00
Fraunhofer IIS FDK da5b0dcb3c Restrict size of huffman escape sequence to prevent shift with too large exponent in DecodeEscapeSequence().
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ibcd182e313e9ef480e92619023bf424762b92e23
2019-10-14 15:19:19 -07:00
Fraunhofer IIS FDK 15965e3feb Limit too large shift exponent in CJointStereo_ApplyMS()
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ia6ab654654e899368ba207a66eddf22b6b855635
2019-10-14 15:14:28 -07:00
Fraunhofer IIS FDK f26eb8af7c Fix CpePersistentData memory leak.
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Iee5c93d61088bbda2328099ad20413adae3fa09b
2019-10-10 12:45:54 -07:00
Fraunhofer IIS FDK 128abf6b1a Validate aacSampleRate after applying ELD downscale factor. Avoid division by zero.
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I3f7ece9451121d40fab2c97571c695c1ac62bd00
2019-10-10 12:42:13 -07:00
Martin Storsjo e365f4f278 Merge remote-tracking branch 'aosp/master' 2019-10-08 14:53:07 +03:00
Fraunhofer IIS FDK e970ac4c95 Fix HE-AAC using MPEG-D DRC with implicit SBR signaling.
Bug: 132641988
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I97c5d3972528092f627153ad3127c7db977a0e5d
2019-05-13 15:24:51 -07:00
Fraunhofer IIS FDK 14f7e13693 MPEG-4/D DRC unification, loudness norm default at -24
Unify API parameter of MPEG-4/D DRC and introduce rounding to boost/compress setParam function (FDKdec v3.1.1).

Enable Loudness Normalization with target loudness -24 by default (FDKdec v3.1.2).

Bug: 131255165
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I249a36b4861d0c8d4a0ed2df4dc1f444576bac6b
2019-04-25 09:35:00 -07:00
Fraunhofer IIS FDK 37972d5a1f Add support for Album Mode (FDKdec v3.1.0).
Bug: 131255165
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I6b4b176ec497587238537bddd89889341733d4e2
2019-04-24 22:56:19 +00:00
Fraunhofer IIS FDK 856e3d339e Trigger config change after a change in SBR activity has been recognized.
Change-Id: I7715e61fdfcd16dfae6029171888aef9c6f0738e
2019-03-15 10:32:59 -07:00
Martin Storsjo 4edc5c4808 Merge remote-tracking branch 'aosp/master' 2019-03-15 14:03:19 +02:00
Xin Li 8e6b62378b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into stage-aosp-master
Bug: 124234733
Change-Id: I7ed72a237fd7f0aa984b8077a369a1ddb5ba253b
2019-02-12 09:53:34 -08:00
Jean-Michel Trivi 169e4207a3 Merge "Add QMF analysis band sanity check" am: b30e02cfd3 am: db4a1deb28
am: 6ff2d3cf8e

Change-Id: I12bc58a0ed01daba0295a4a8feab853b6cc3f0f0
2019-02-01 07:54:00 -08:00
Jean-Michel Trivi 6ff2d3cf8e Merge "Add QMF analysis band sanity check" am: b30e02cfd3
am: db4a1deb28

Change-Id: I0b4b5de02becd0a105e9958231ef2e58000d2cc8
2019-02-01 07:49:57 -08:00
Jean-Michel Trivi b30e02cfd3 Merge "Add QMF analysis band sanity check" 2019-02-01 15:34:03 +00:00
Martin Storsjo 02103fd630 Merge remote-tracking branch 'aosp/master' 2019-01-21 15:54:25 +02:00
Jean-Michel Trivi 2a2c62fbed Merge "Do not support channel configuration change within PCE" am: ed56e77acb am: a82589476a
am: 7ca245e21e

Change-Id: Ic339d07a62ddbecdc6c2efcd5834e5758c90f70f
2019-01-15 11:29:03 -08:00
Jean-Michel Trivi 7ca245e21e Merge "Do not support channel configuration change within PCE" am: ed56e77acb
am: a82589476a

Change-Id: Ie9de704ba4aee6954e9ca82df8c56bc81a482c32
2019-01-15 11:19:49 -08:00
Jean-Michel Trivi ed56e77acb Merge "Do not support channel configuration change within PCE" 2019-01-15 18:46:27 +00:00
Fraunhofer IIS FDK c47066df27 Add QMF analysis band sanity check
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I0001e0996a970e91a21bfe8ba051fdba0c06c219
2019-01-15 12:19:05 -05:00
Fraunhofer IIS FDK 9dc118a7d1 Merge "Add AOT specific number of qmf bands sanity check in SpatialSpecificConfig()" am: bcda185d56 am: 4ab4454f29
am: 6d1247f2e2

Change-Id: I1552fb42268ad2b019b728a8d61561a9028a60ad
2019-01-03 17:10:27 -08:00
Fraunhofer IIS FDK 6d1247f2e2 Merge "Add AOT specific number of qmf bands sanity check in SpatialSpecificConfig()" am: bcda185d56
am: 4ab4454f29

Change-Id: I0ac3055487ce17f6218e3a0644778a0d8da27119
2019-01-03 17:05:25 -08:00
Fraunhofer IIS FDK 5c54fa5387 Add AOT specific number of qmf bands sanity check in SpatialSpecificConfig()
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: Ic106c4371c5ac17cb832c7d9db042bcc9d1e7a09
2019-01-03 10:25:40 -05:00
Fraunhofer IIS FDK e81e8c2cc0 Do not support channel configuration change within PCE
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I94bddad6c88148dd01fff0850e261d98ef691793
2019-01-02 14:01:25 -05:00
Fraunhofer IIS FDK b6c47c51b2 Merge "Prevent energy overflow in acelp calc_period_factor()" am: eb9319afb2 am: 196f1ce484
am: b29fd0db45

Change-Id: Ic3acadc0a8a48485b96075882eebfd867cfc709e
2018-12-29 06:25:51 -08:00
Fraunhofer IIS FDK b29fd0db45 Merge "Prevent energy overflow in acelp calc_period_factor()" am: eb9319afb2
am: 196f1ce484

Change-Id: I4bcc2e7ff145bffb7f11a090e8a048e9c2d11d76
2018-12-29 06:16:43 -08:00
Fraunhofer IIS FDK f4fc574fdd Prevent energy overflow in acelp calc_period_factor()
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I5a28fcb09a1b0b0d1f8861642c64185937021154
2018-12-28 19:42:49 -05:00
Jean-Michel Trivi d00da81a1d Merge "Skip CRC check when flushing or concealment is applied" am: 385764944d am: 7c9f1165e7
am: 7b664f0bea

Change-Id: I205000a7dd682df83dff15afbd35772ed7c14a0f
2018-12-28 15:24:40 -08:00
Jean-Michel Trivi 7b664f0bea Merge "Skip CRC check when flushing or concealment is applied" am: 385764944d
am: 7c9f1165e7

Change-Id: Ia818ae31a012d18cefad45ea969123d09ff6e31a
2018-12-28 15:19:17 -08:00
Fraunhofer IIS FDK 0ca9742ad2 Skip CRC check when flushing or concealment is applied
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I0f340eb0fe7f5ee8778a73fbe27199ba4915de70
2018-12-27 17:55:50 -05:00
Jean-Michel Trivi 55efc0ade2 Merge changes I97471c4d,I8a8626a8,I1f176740,I10da23ee,I9f9064fb am: ecc96969d7 am: f5512132f3
am: d6459f539c

Change-Id: I15844b575d276334d5a960a73cf556f5f82fcff3
2018-12-27 14:49:05 -08:00
Jean-Michel Trivi d6459f539c Merge changes I97471c4d,I8a8626a8,I1f176740,I10da23ee,I9f9064fb am: ecc96969d7
am: f5512132f3

Change-Id: Ie01b6d6c881c4c9a52af921eee9f7ced6fd6880e
2018-12-27 14:39:49 -08:00
Fraunhofer IIS FDK 0cebd077b6 Apply sbrDecoder_Parse() function for all explict SBR elements
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I97471c4db309307a21100f1d5d88d3c4e24d2670
2018-12-27 14:51:52 -05:00
Fraunhofer IIS FDK 8f5b1e47d6 Add missing break in order to avoid a fallthrough in setConcealMethod()
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I10da23ee81cfc48d4a67c25006e6fd48ed985c69
2018-12-27 14:39:43 -05:00
Fraunhofer IIS FDK 64134e60b3 Add FDK_FALLTHROUGH macro to prevent implicit-fallthrough compiler warnings
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I9f9064fb63ac40e18f245c00b7375b4874f2925b
2018-12-27 14:17:51 -05:00
Jean-Michel Trivi 61b3c49df0 Merge "Signed Integer Overflows in imlt_block()" am: 55930c28af am: 7d959f2f30
am: 83ba3e096a

Change-Id: I0805e8ba62c75a16c9df2d2169c79b8ddbd0974e
2018-12-27 09:36:33 -08:00
Jean-Michel Trivi 83ba3e096a Merge "Signed Integer Overflows in imlt_block()" am: 55930c28af
am: 7d959f2f30

Change-Id: Iea1e4a89029523511bef926c98ee23e9bcb216fe
2018-12-27 09:31:32 -08:00
Jean-Michel Trivi 437b7440d1 Merge "Unsigned Integer Overflow in InitSegmentBitfield()" am: 4899e80a17 am: ca0d8e7461
am: cafc42b5eb

Change-Id: Icd717282e22dfb01b678836f0a50eb9b56db9f0f
2018-12-26 18:53:44 -08:00
Jean-Michel Trivi cafc42b5eb Merge "Unsigned Integer Overflow in InitSegmentBitfield()" am: 4899e80a17
am: ca0d8e7461

Change-Id: Ia4e0396a4df14d667f80aded10631815b715e2c2
2018-12-26 18:35:45 -08:00
Jean-Michel Trivi 58600c035a Merge "Unsigned Integer Overflow in CAacDecoder_PreRollExtensionPayloadParse()" am: a5cf260931 am: 466adf2a1b
am: d07eeb453f

Change-Id: Id09444e5b08161f79053c09e42d686551a2b05e5
2018-12-26 18:19:25 -08:00
Jean-Michel Trivi 3f50499c9c Merge "Prevent overflow in usac filters" am: 4053380094 am: eaad782db3
am: 18d4dcf255

Change-Id: Id1736dd6af5b656c158896f6d9fcb117231351a4
2018-12-26 18:18:55 -08:00
Jean-Michel Trivi 0694a4e1e8 Merge "Signed Integer Overflow in CLpd_FAC_Acelp2Mdct()" am: 3bb4fe68a6 am: 8879fb1fd6
am: 350e4ffea2

Change-Id: I5f6e1d37824f13d791edd8433aac9c591bbfc399
2018-12-26 18:18:35 -08:00
Fraunhofer IIS FDK fa8a80d890 Signed Integer Overflows in imlt_block()
Bug: 112890242
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I98fda0eea7f7223d76df31776c6723b618e5b581
2018-12-26 21:15:07 -05:00
Jean-Michel Trivi 4899e80a17 Merge "Unsigned Integer Overflow in InitSegmentBitfield()" 2018-12-27 02:10:25 +00:00
Jean-Michel Trivi d07eeb453f Merge "Unsigned Integer Overflow in CAacDecoder_PreRollExtensionPayloadParse()" am: a5cf260931
am: 466adf2a1b

Change-Id: I354fe7ee0401e1e154ae42ce9a80672db8a84d08
2018-12-26 18:08:21 -08:00
Jean-Michel Trivi 18d4dcf255 Merge "Prevent overflow in usac filters" am: 4053380094
am: eaad782db3

Change-Id: I86ee269643f3247138c71ffe88a2a589bfce0357
2018-12-26 18:07:50 -08:00
Jean-Michel Trivi 350e4ffea2 Merge "Signed Integer Overflow in CLpd_FAC_Acelp2Mdct()" am: 3bb4fe68a6
am: 8879fb1fd6

Change-Id: I955c6e7d250ac52986aeb0879dad976dd62d3fab
2018-12-26 18:07:32 -08:00
Jean-Michel Trivi a5cf260931 Merge "Unsigned Integer Overflow in CAacDecoder_PreRollExtensionPayloadParse()" 2018-12-27 01:58:50 +00:00
Jean-Michel Trivi 4053380094 Merge "Prevent overflow in usac filters" 2018-12-27 01:54:49 +00:00
Jean-Michel Trivi 3bb4fe68a6 Merge "Signed Integer Overflow in CLpd_FAC_Acelp2Mdct()" 2018-12-27 01:51:53 +00:00
Jean-Michel Trivi 2ddc635e1d Merge "Signed Integer Overflow in E_UTIL_preemph()" am: aea2558c50 am: b471c2c215
am: f69ca4c614

Change-Id: I78ee4dccc649e0ff2ee4006212795d89c2f8233c
2018-12-26 17:10:27 -08:00
Jean-Michel Trivi f69ca4c614 Merge "Signed Integer Overflow in E_UTIL_preemph()" am: aea2558c50
am: b471c2c215

Change-Id: Ib6f14a5f7b33ffb8bce1a9b37531c0872eeceb2e
2018-12-26 17:06:27 -08:00
Fraunhofer IIS FDK 950d8efb1a Unsigned Integer Overflow in InitSegmentBitfield()
Bug: 112662995
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ida3b1d49dc35a03a3ff02f6e150cfb55e9e1da11
2018-12-26 19:45:18 -05:00
Fraunhofer IIS FDK 512898b298 Unsigned Integer Overflow in CAacDecoder_PreRollExtensionPayloadParse()
Bug: 112661610
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I96e2c10328fec8fd12f9c752904860b87a72bed2
2018-12-26 19:39:27 -05:00
Fraunhofer IIS FDK 8166502969 Prevent overflow in usac filters
Bug: 112663886
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ie7af65a1a556afb141ea5272f70bfea11881ac30
2018-12-26 19:19:34 -05:00
Fraunhofer IIS FDK 1450575edf Signed Integer Overflow in CLpd_FAC_Acelp2Mdct()
Bug: 112663384
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I5e41f1455ab35060c136abb7f4945fe9a545633c
2018-12-26 18:42:14 -05:00
Fraunhofer IIS FDK 9edc5864fa Signed Integer Overflow in E_UTIL_preemph()
Bug: 112661356
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ibc7120aba3d357bfb8d751d80d99a6e0f51473e4
2018-12-26 18:20:17 -05:00
Xin Li 20c336953f DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Ie44ac2dc553c40a8a9bd9b42b00a0b01cfa9799a
2018-12-11 13:59:07 -08:00
Fraunhofer IIS FDK bf8adf21ad Merge "Integer overflow fix in InvMdctTransformLowDelay_fdk()" am: d2be744af2 am: 6e4fe2e06b
am: 69e052a1af

Change-Id: I17eca04703b565d22659b6a3f8d08e16a818aedc
2018-11-29 11:05:17 -08:00
Fraunhofer IIS FDK 69e052a1af Merge "Integer overflow fix in InvMdctTransformLowDelay_fdk()" am: d2be744af2
am: 6e4fe2e06b

Change-Id: Ie017463a9aad54c9b02672c0aa4d1e7f06847427
2018-11-29 11:00:16 -08:00
Fraunhofer IIS FDK 24648cbd4f Integer overflow fix in InvMdctTransformLowDelay_fdk()
Bug: 112892194
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I47fdb5b51afd8c588607bf206d4ae3ef4ba1cdb3
2018-11-28 18:09:43 -05:00
Fraunhofer IIS FDK 07ed1f756b Merge "Add sanity check for allowed LPD sampling rate." am: b8a384b0cd
am: 9cfaf0cd45

Change-Id: I0c9952fe8b16ae2e8d4cb80b30d63ba00e172b09
2018-11-28 13:40:48 -08:00
Treehugger Robot b8a384b0cd Merge "Add sanity check for allowed LPD sampling rate." 2018-11-28 21:21:41 +00:00
Fraunhofer IIS FDK c6b4af4a6c Add sanity check for allowed LPD sampling rate.
Bug: 112662981
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I0702024adc07ed463db795dd48f4efd3de1d7896
Merged-In: Idc9c44a9755b8151d5c7d8107696f43ac592413b
2018-11-28 19:15:09 +00:00
Fraunhofer IIS FDK 3a64e48ede Merge "Unsigned Integer Overflow in aacDecoder_DecodeFrame()." am: 0a1e3b6ef9
am: c580437d7c

Change-Id: Id8f177954c585644d0535a44560fa3923780a764
2018-11-27 11:13:30 -08:00
Fraunhofer IIS FDK eb0711921b Unsigned Integer Overflow in aacDecoder_DecodeFrame().
Bug: 112661742
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I617dd545f9ea0aca5a5e7d214bbc35f089bc355d
2018-11-27 12:30:10 -05:00
Martin Storsjo 2326faaf8f Merge remote-tracking branch 'aosp/master' 2018-11-06 09:03:05 +02:00
Fraunhofer IIS FDK a16b4cba47 Merge "Fix huffman decoder escape sequence length limitation." am: a4d6ca7b07
am: ac56cddd1f

Change-Id: I422463f26359bef0ad3220c9324ceb26fcd1da14
2018-11-05 15:14:17 -08:00
Treehugger Robot a4d6ca7b07 Merge "Fix huffman decoder escape sequence length limitation." 2018-11-05 22:58:33 +00:00
Fraunhofer IIS FDK f90be06503 Fix huffman decoder escape sequence length limitation.
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Bug: 112661753

Change-Id: Ib05cc2c065739c27b9720a24f90d0ce4d15bf601
Merged-In: 62623d8d79
2018-11-05 14:43:14 -05:00
Fraunhofer IIS FDK 0e5db9fee9 Unify audio element loop abort criterion in ER syntax
Bug: 112891548
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Iea56cf804cfb9d396810124c718fc91bdff68392
(cherry picked from commit f2bc07da2e)
2018-10-20 00:17:00 +00:00
Fraunhofer IIS FDK ce97e7d55e Always check whether given channel config is supported.
Bug: 112660981
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I169161dd31bc624f2cab6be2b4c6518946ed32ba
Merged-In: I169161dd31bc624f2cab6be2b4c6518946ed32ba
(cherry picked from commit 25b209f229)
2018-10-20 00:16:57 +00:00
Martin Storsjo 69a9b1a051 Merge remote-tracking branch 'aosp/master' 2018-10-16 09:45:37 +03:00
Jean-Michel Trivi 72f73bc52e Merge "Fix call to function sbrDecoder_Header() through pointer to incorrect function type." am: fb65c0c24b
am: 40676e7cba

Change-Id: I07d03570c8173eff319c102ce73c51025afdd056
2018-10-12 12:01:26 -07:00
Fraunhofer IIS FDK 9db742a7d3 Fix call to function sbrDecoder_Header() through pointer to incorrect function type.
While testing FDK in Android P DP3 x86 64bit emulator we observed a runtime error.
The function parameter of the callback didn't use a typeless pointer.
Following patch contains a revised sbr decoder callback function with explicit data type cast to be inline with all other callbacks in FDK.

Bug: 112662306
Bug: 116075869
Test: on x86: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: Id224de22beaf2eb9631babd838c4c3ceae0a801e
Merged-In: Idc9c44a9755b8151d5c7d8107696f43ac592413b
2018-10-12 12:02:30 -04:00
Jean-Michel Trivi 13846446b7 Merge "Unify audio element loop abort criterion in ER syntax" into pi-dev am: 28234107a7
am: 4a6124d231

Change-Id: I12aa62bfe5cc0c2900e6eb0e5427dba5f8a40068
2018-10-01 17:14:22 -07:00
Jean-Michel Trivi 28234107a7 Merge "Unify audio element loop abort criterion in ER syntax" into pi-dev 2018-10-01 22:19:05 +00:00
Fraunhofer IIS FDK 25b209f229 Always check whether given channel config is supported.
Bug: 112660981
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I169161dd31bc624f2cab6be2b4c6518946ed32ba
Merged-In: I169161dd31bc624f2cab6be2b4c6518946ed32ba
2018-09-28 16:47:37 +00:00
Fraunhofer IIS FDK 3dd3822755 Always check whether given channel config is supported.
Bug: 112660981
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I169161dd31bc624f2cab6be2b4c6518946ed32ba
2018-09-28 08:28:16 -07:00
Fraunhofer IIS FDK f2bc07da2e Unify audio element loop abort criterion in ER syntax
Bug: 112891548
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Iea56cf804cfb9d396810124c718fc91bdff68392
2018-09-27 14:28:50 -07:00
Fraunhofer IIS FDK 9744e41c40 Prevent bit buffer counter overflow.
While long-term test we discovered a bit counter overflow in the bit buffer.
The bit buffer state was only used by HCR and RVLC tool and can easily be substituted with FDKgetValidBits() call.
The following patch completely removes the bit counter and all its obsolete functions.

Bug: 112662184
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: Icee0519d26a2aa62367d2dece59cd3d60ffcade7
(cherry picked from commit 15292f7e96)
2018-09-10 23:19:19 +00:00
Fraunhofer IIS FDK 61381bd0f4 Break audio element loop in case element_count becomes too large.
Bug: 112891564
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I35f02d23c0cfd620088291a52d9996a0d5a17199
(cherry picked from commit 3347cfb91a)
2018-09-10 23:19:16 +00:00
Jean-Michel Trivi 42f714f2ab Merge "Prevent bit buffer counter overflow." into pi-dev 2018-09-06 23:02:17 +00:00
Jean-Michel Trivi 8f5c6c2b21 Merge "Break audio element loop in case element_count becomes too large." into pi-dev am: 4d801e44ba
am: a083f27afb

Change-Id: I08e08b06d45c782f7cea15b06d370a0ef9920db2
2018-09-06 14:45:44 -07:00
Jean-Michel Trivi 4d801e44ba Merge "Break audio element loop in case element_count becomes too large." into pi-dev 2018-09-06 21:15:30 +00:00
Fraunhofer IIS FDK 983a134adb Merge "Prevent overflow in concealment clipping check" into pi-dev am: b3ea08e059
am: 646ead1a65

Change-Id: I76943ca6e6c4541924c34ce6e7da5bf95676abec
2018-09-06 13:34:42 -07:00
Fraunhofer IIS FDK f44b50b835 Prevent overflow in concealment clipping check
Bug: 112890225
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ie386e4b6fe5cdb38180f673edde8f84c36c7b522
2018-09-05 15:03:18 -07:00
Fraunhofer IIS FDK 3347cfb91a Break audio element loop in case element_count becomes too large.
Bug: 112891564
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I35f02d23c0cfd620088291a52d9996a0d5a17199
2018-09-05 14:54:44 -07:00
Martin Storsjo 9b47a5e569 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
2018-09-03 10:10:12 +03:00
Martin Storsjo 99c95ca3ea Initialize the transport decoder library with TPDEC_PARAM_IGNORE_BUFFERFULLNESS
Prior to FDKv2, this was what the library used to do.

This makes sure that the decoder actually decodes ADTS frames directly
if feeding full ADTS frames to the decoder. Previously after FDKv2,
the decoder would only start decoding ADTS frames after feeding a few
frames.
2018-09-03 09:57:53 +03:00
Martin Storsjo 59995402a5 Add an fdk_ prefix to t_qua_gain7b
This fixes symbol collisions, if libfdk-aac and libopencore-amr are
statically linked into the same binary.
2018-09-02 23:18:06 +03:00
Fraunhofer IIS FDK 15292f7e96 Prevent bit buffer counter overflow.
While long-term test we discovered a bit counter overflow in the bit buffer.
The bit buffer state was only used by HCR and RVLC tool and can easily be substituted with FDKgetValidBits() call.
The following patch completely removes the bit counter and all its obsolete functions.

Bug: 112662184
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: Icee0519d26a2aa62367d2dece59cd3d60ffcade7
2018-08-17 16:36:07 -07:00
Fraunhofer IIS FDK 62623d8d79 FDK sanitization fixes
Bug: 110641440
Bug: 109936783
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Prevent bit buffer counter overflow.

While long-term test we discovered a bit counter overflow in the bit buffer.
The bit buffer state was only used by HCR and RVLC tool and can easily be substituted with FDKgetValidBits() call.
The following patch completely removes the bit counter and all its obsolete functions.

Change-Id: Icee0519d26a2aa62367d2dece59cd3d60ffcade7

Fix call to function sbrDecoder_Header() through pointer to incorrect function type.

While testing FDK in Android P DP3 x86 64bit emulator we observed a runtime error.
The function parameter of the callback didn't use a typeless pointer.
Following patch contains a revised sbr decoder callback function with explicit data type cast to be inline with all other callbacks in FDK.

Change-Id: Id224de22beaf2eb9631babd838c4c3ceae0a801e

Fix huffman decoder escape sequence length limitation.

Change-Id: Ib05cc2c065739c27b9720a24f90d0ce4d15bf601

Prevent overflow in MPEG-D DRC _setSelectionDataInfo().

Change-Id: I3b90ef7a5168e20766a2574d57d81bb39d2a5fb9

Add sanity check for allowed LPD sampling rate.

Change-Id: I0702024adc07ed463db795dd48f4efd3de1d7896

Always check whether given channel config is supported.

Change-Id: I169161dd31bc624f2cab6be2b4c6518946ed32ba

Unsigned Integer Overflow in aacDecoder_DecodeFrame().

Change-Id: I617dd545f9ea0aca5a5e7d214bbc35f089bc355d

Unsigned Integer Overflow in SpatialDecParseSpecificConfigHeader().

Change-Id: I5994a55f993835fa511ff61a337726b3e51aed5d

Unsigned Integer Overflows in mpegSurroundDecoder_Parse().

Change-Id: I3714e88d7a9a866297bb2e93571804665a97773f

Unsigned Integer Overflow in transportDec_AdjustEndOfAccessUnit().

Change-Id: Ie4924460d30ea4ef76917704ded809d04db78993

Unsigned Integer Overflow in transportDec_readHeader().

Change-Id: I0beedab38175fc57e5bd9eb5700a3850ef2bebf7

UBSAN overflow in FFT

An overflow in the fft was observed for certain configurations. The root cause was in the scaling of the fft input data in dct_IV and dst_IV.
The following patch revises the scaling in dct and removes the unused arm implementation.

Change-Id: Idc9c44a9755b8151d5c7d8107696f43ac592413b
2018-08-14 16:56:02 +00:00
Fraunhofer IIS FDK f19e863cce Fix unsigned integer overflow in aacDecoder_UpdateBitStreamCounters()
Bug: 80314771
Test: play AAC content over 2GB
Change-Id: If791305bf95680b945971f9dc5f58495cbf6c8cd
2018-05-25 15:38:52 -07:00
Fraunhofer IIS FDK a4d1f0ad52 FDKv2 ubsan patches
Bug: 80053205
Test: see bug for repro with FB "wow"
   atest DecoderTestAacDrc

Fix signed integer overflows in CLpc_SynthesisLattice()

Change-Id: Icbddfcc8c5fc73382ae5bf8c2a7703802c688e06

Fix signed integer overflows in imlt

Change-Id: I687834fca2f1aab6210ed9862576b4f38fcdeb24

Fix overflow in addLowbandEnergies()

Change-Id: Iaa9fdf9deb49c33ec6ca7ed3081c4ddaa920e9aa

Concealment fix for audio frames containing acelp components

Change-Id: Ibe5e83a6efa75a48f729984a161a76b826878f4e

Fix out-of-bounds access in PS concealment

Change-Id: I08809a03a40d1feaf00e41278db314d67e1efe88

Fix potential memory leak in setup of qmf domain

Change-Id: Id9fc2448354dc7f1b439469128407305efa3def2

Reject channel config 13

Change-Id: Idf5236f6cd054df994e69c9c972c97f6768cf9e5

Fix unsigned integer overflow in configExtension()

Change-Id: I8a1668810b85e6237c3892891444ff08f04b019b

Fix unsigned integer overflow in CAacDecoder_DecodeFrame()

Change-Id: I79678c571690178e6c37680f70a9b94dd3cbc439

Fix unsigned integer overflow in aacDecoder_UpdateBitStreamCounters()

Change-Id: I3bff959da9f53fabb18cd0ae6c260e6256194526

Fix unsigned integer overflow in transportDec_readStream()

Change-Id: I6a6f9f4acaa32fae0b5de9641f8787bbc7f8286b
2018-05-23 12:19:40 -07:00
Fraunhofer IIS FDK 44ac411683 FDK patches: fix overflows in decoder out-of-band config
Bug: 71430241
Bug: 79220129
Test: cts-tradefed run commandAndExit cts-dev -m CtsMediaTestCases -t android.media.cts.DecoderTestXheAac
      cts-tradefed run commandAndExit cts-dev -m CtsMediaTestCases -t android.media.cts.DecoderTestAacDrc

Unsigned Integer Overflows in CDataStreamElement_Read()

Change-Id: Ic2f5b3ae111bf984d4d0db664823798957b0a979

Unsigned Integer Overflow in CProgramConfig_ReadHeightExt()

Change-Id: Iaebc458bb59504203e604a28ed6d5cecaa875c42

Unsigned Integer Overflow in transportDec_OutOfBandConfig()

Change-Id: I24a4b32d736f28c55147f0e2ca06fe5537da19c2

Unsigned Integer Overflows in CDKcrcEndReg() & crcCalc()

Change-Id: I6ebbe541a4d3b6bacbd5ace17264972951de7ca8

Unsigned Integer Overflows in ReadPsData()

Change-Id: Id36576fe545236860a06f17971494ecd4484c494

Unsigned Integer Overflow in SpatialDecParseSpecificConfig()

Change-Id: Ib468f129a951c69776b88468407f008ab4cfd2c7

Unsigned Integer Overflows in _readUniDrcConfigExtension() & _readLoudnessInfoSetExtension()

Change-Id: Ibcf7c6a23af49239206ea9301c58adac36e3ceba
2018-05-09 15:15:28 -07:00
Fraunhofer IIS FDK 9ab67882ec FDKv2 additional fixes
Bug: 71430241
Bug: 79220129
Test: cts-tradefed run commandAndExit cts-dev -m CtsMediaTestCases -t android.media.cts.DecoderTestXheAac
      cts-tradefed run commandAndExit cts-dev -m CtsMediaTestCases -t android.media.cts.DecoderTestAacDrc

Add restriction to call intensity stereo tool only for applicable configurations

Change-Id: I30ec6640bd484c56cc9d5b8b35186fc1c875e021

Fix high band energy calculation in sbr encoder

Change-Id: I964dd46fab2ed797c440a983512bbab7e1aff98a

Fix out-of-bounds read access in noiseless coder

Change-Id: I9a669435dbdca421ff9e4affec57811002d75b3b

Use temporary buffer for dummy parsing to check presence of audioPreroll data

Change-Id: I2d42c5c8deddde34351c3d2858b9fe196b3a0906

Set applyAsc to 1 in case that the ASC parsing fails

Change-Id: I552a8b960270bc18cae459ad28a3ba241035668e

Parametric stereo together with mps not supported

Change-Id: Icde14a2774a4303bb0c41046861a59d04b624365

Align ssc callback error path for drm

Change-Id: Ie8ecbfa42c702e6df81c1aec532a9ff1e653dac9

Ensure that the bit counter starts at a multiple of TPDEC_SYNCSKIP

Change-Id: I08d69ec361b2e2ed800282e333fd248b4b3ca245

Allow flushing only when audioPreroll is enabled in current and new config

Change-Id: I52e95d75de4bbed692be922a59a23bda58870625

Omit reverse channel mapping in pass through mode

Change-Id: I335e209c29a700cc091be069f1d08e4288b40793
2018-05-04 11:05:58 -07:00