@@ -15,7 +15,8 @@ INIT_RUNTIME(2);
1515#include <ia2_compartment_init.inc>
1616
1717Test (type_confusion , normal ) {
18- Dav1dContext * c = dav1d_alloc (sizeof (Dav1dContext ));
18+ // `Dav1dContext` is opaque.
19+ Dav1dContext * c = dav1d_alloc (DAV1D_CONTEXT_SIZE );
1920 Dav1dSettings * settings = dav1d_alloc (sizeof (Dav1dSettings ));
2021 Dav1dPicture * pic = dav1d_alloc (sizeof (Dav1dPicture ));
2122
@@ -29,8 +30,8 @@ Test(type_confusion, normal) {
2930}
3031
3132Test (type_confusion , uninitialized , .signal = SIGABRT ) {
32- Dav1dContext * c = dav1d_alloc (sizeof ( Dav1dContext ) );
33- Dav1dContext * c2 = dav1d_alloc (sizeof ( Dav1dContext ) );
33+ Dav1dContext * c = dav1d_alloc (DAV1D_CONTEXT_SIZE );
34+ Dav1dContext * c2 = dav1d_alloc (DAV1D_CONTEXT_SIZE );
3435 Dav1dSettings * settings = dav1d_alloc (sizeof (Dav1dSettings ));
3536 Dav1dPicture * pic = dav1d_alloc (sizeof (Dav1dPicture ));
3637
@@ -46,7 +47,7 @@ Test(type_confusion, uninitialized, .signal = SIGABRT) {
4647}
4748
4849Test (type_confusion , wrong_type , .signal = SIGABRT ) {
49- Dav1dContext * c = dav1d_alloc (sizeof ( Dav1dContext ) );
50+ Dav1dContext * c = dav1d_alloc (DAV1D_CONTEXT_SIZE );
5051 Dav1dSettings * settings = dav1d_alloc (sizeof (Dav1dSettings ));
5152 Dav1dPicture * pic = dav1d_alloc (sizeof (Dav1dPicture ));
5253
@@ -61,7 +62,7 @@ Test(type_confusion, wrong_type, .signal = SIGABRT) {
6162}
6263
6364Test (type_confusion , null , .signal = SIGABRT ) {
64- Dav1dContext * c = dav1d_alloc (sizeof ( Dav1dContext ) );
65+ Dav1dContext * c = dav1d_alloc (DAV1D_CONTEXT_SIZE );
6566 Dav1dSettings * settings = dav1d_alloc (sizeof (Dav1dSettings ));
6667 Dav1dPicture * pic = dav1d_alloc (sizeof (Dav1dPicture ));
6768
@@ -76,7 +77,7 @@ Test(type_confusion, null, .signal = SIGABRT) {
7677}
7778
7879Test (type_confusion , use_after_free , .signal = SIGABRT ) {
79- Dav1dContext * c = dav1d_alloc (sizeof ( Dav1dContext ) );
80+ Dav1dContext * c = dav1d_alloc (DAV1D_CONTEXT_SIZE );
8081 Dav1dSettings * settings = dav1d_alloc (sizeof (Dav1dSettings ));
8182 Dav1dPicture * pic = dav1d_alloc (sizeof (Dav1dPicture ));
8283
0 commit comments