File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1266,7 +1266,7 @@ pub fn read_avif<T: Read>(f: &mut T, context: &mut AvifContext) -> Result<()> {
1266
1266
1267
1267
let meta = meta. ok_or ( Error :: InvalidData ( "missing meta" ) ) ?;
1268
1268
1269
- let alpha_item_id = meta
1269
+ let mut alpha_item_ids = meta
1270
1270
. item_references
1271
1271
. iter ( )
1272
1272
// Auxiliary image for the primary image
@@ -1288,8 +1288,11 @@ pub fn read_avif<T: Read>(f: &mut T, context: &mut AvifContext) -> Result<()> {
1288
1288
_ => false ,
1289
1289
}
1290
1290
} )
1291
- } )
1292
- . next ( ) ;
1291
+ } ) ;
1292
+ let alpha_item_id = alpha_item_ids. next ( ) ;
1293
+ if alpha_item_ids. next ( ) . is_some ( ) {
1294
+ return Err ( Error :: InvalidData ( "multiple alpha planes" ) ) ;
1295
+ }
1293
1296
1294
1297
context. premultiplied_alpha = alpha_item_id. map_or ( false , |alpha_item_id| {
1295
1298
meta. item_references . iter ( ) . any ( |iref| {
You can’t perform that action at this time.
0 commit comments