• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "../includes/common.h"
18 #include "../includes/memutils_track.h"
19 #include "../includes/omxUtils.h"
20 #include "codecs/mp3dec/src/s_tmp3dec_file.h"
21 #include "media/omx/1.0/WOmx.h"
22 #include "omx/include/media/stagefright/omx/1.0/Omx.h"
23 
24 char enable_selective_overload = ENABLE_NONE;
is_tracking_required(size_t size)25 bool is_tracking_required(size_t size) {
26   return (size == sizeof(tmp3dec_file));
27 }
28 
main()29 int main() {
30 
31 #if _32_BIT
32   android::ProcessState::self()->startThreadPool();
33   using namespace ::android::hardware::media::omx::V1_0;
34   sp<IOmx> omx = new implementation::Omx();
35   if (!omx) {
36     return EXIT_FAILURE;
37   }
38   sp<IOMX> mOMX = new utils::LWOmx(omx);
39   if (!mOMX) {
40     return EXIT_FAILURE;
41   }
42   sp<IOMXNode> mOMXNode = nullptr;
43   enable_selective_overload = ENABLE_MALLOC_CHECK;
44   mOMX->allocateNode("OMX.google.mp3.decoder", NULL, &mOMXNode);
45   enable_selective_overload = ENABLE_NONE;
46   if (is_memory_uninitialized()) {
47     return EXIT_VULNERABLE;
48   }
49 #endif /* _32_BIT */
50 
51   return EXIT_SUCCESS;
52 }
53