@@ -341,7 +341,7 @@ pub enum Mp4parseAvifLoopMode {
341341}
342342
343343#[ repr( C ) ]
344- #[ derive( Debug ) ]
344+ #[ derive( Debug , Default ) ]
345345pub struct Mp4parseAvifInfo {
346346 pub premultiplied_alpha : bool ,
347347 pub major_brand : [ u8 ; 4 ] ,
@@ -383,7 +383,7 @@ pub struct Mp4parseAvifInfo {
383383}
384384
385385#[ repr( C ) ]
386- #[ derive( Debug ) ]
386+ #[ derive( Debug , Default ) ]
387387pub struct Mp4parseAvifImage {
388388 pub primary_image : Mp4parseByteData ,
389389 /// If no alpha item exists, members' `.length` will be 0 and `.data` will be null
@@ -1170,6 +1170,9 @@ pub unsafe extern "C" fn mp4parse_avif_get_info(
11701170 return Mp4parseStatus :: BadArg ;
11711171 }
11721172
1173+ // Initialize fields to default values to ensure all fields are always valid.
1174+ * avif_info = Default :: default ( ) ;
1175+
11731176 if let Ok ( info) = mp4parse_avif_get_info_safe ( ( * parser) . context ( ) ) {
11741177 * avif_info = info;
11751178 Mp4parseStatus :: Ok
@@ -1352,6 +1355,9 @@ pub unsafe extern "C" fn mp4parse_avif_get_image(
13521355 return Mp4parseStatus :: BadArg ;
13531356 }
13541357
1358+ // Initialize fields to default values to ensure all fields are always valid.
1359+ * avif_image = Default :: default ( ) ;
1360+
13551361 if let Ok ( image) = mp4parse_avif_get_image_safe ( & * parser) {
13561362 * avif_image = image;
13571363 Mp4parseStatus :: Ok
0 commit comments