Skip to content

Commit 77d5d46

Browse files
committed
Address review comments
1 parent fda1b81 commit 77d5d46

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

mp4parse_capi/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,8 +1189,8 @@ fn mp4parse_get_track_video_info_safe(
11891189
/// pointer points to a valid `Mp4parseAvifParser`, and that the avif_image
11901190
/// pointer points to a valid `AvifImage`. If there was not a previous
11911191
/// successful call to `mp4parse_avif_read()`, no guarantees are made as to
1192-
/// the state of `avif_image`. If `avif_image.alpha_item` are set with a
1193-
/// positive`length` and non-null `data`, then the `avif_image` contains an
1192+
/// the state of `avif_image`. If `avif_image.alpha_item` is set to a
1193+
/// positive `length` and non-null `data`, then the `avif_image` contains an
11941194
/// valid alpha channel data. Otherwise, the image is opaque.
11951195
#[no_mangle]
11961196
pub unsafe extern "C" fn mp4parse_avif_get_image(
@@ -1203,14 +1203,12 @@ pub unsafe extern "C" fn mp4parse_avif_get_image(
12031203

12041204
// Initialize fields to default values to ensure all fields are always valid.
12051205
*avif_image = Default::default();
1206-
let image_ref = &mut (*avif_image);
1207-
12081206
let context = (*parser).context();
12091207

1210-
image_ref.primary_item.set_data(context.primary_item());
1208+
(*avif_image).primary_item.set_data(context.primary_item());
12111209
if let Some(context_alpha_item) = context.alpha_item() {
1212-
image_ref.alpha_item.set_data(context_alpha_item);
1213-
image_ref.premultiplied_alpha = context.premultiplied_alpha;
1210+
(*avif_image).alpha_item.set_data(context_alpha_item);
1211+
(*avif_image).premultiplied_alpha = context.premultiplied_alpha;
12141212
}
12151213

12161214
Mp4parseStatus::Ok

0 commit comments

Comments
 (0)