File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
symphonia-format-isomp4/src/atoms Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,8 @@ pub struct ESDescriptor {
243
243
244
244
impl ObjectDescriptor for ESDescriptor {
245
245
fn read < B : ReadBytes > ( reader : & mut B , len : u32 ) -> Result < Self > {
246
+ let pos = reader. pos ( ) ;
247
+
246
248
let es_id = reader. read_be_u16 ( ) ?;
247
249
let es_flags = reader. read_u8 ( ) ?;
248
250
@@ -265,6 +267,11 @@ impl ObjectDescriptor for ESDescriptor {
265
267
let mut dec_config = None ;
266
268
let mut sl_config = None ;
267
269
270
+ // len should be bigger than what have been read
271
+ if reader. pos ( ) - pos > len as u64 {
272
+ return decode_error ( "isomp4: es descriptor len is wrong" ) ;
273
+ }
274
+
268
275
let mut scoped = ScopedStream :: new ( reader, u64:: from ( len) - 3 ) ;
269
276
270
277
// Multiple descriptors follow, but only the decoder configuration descriptor is useful.
You can’t perform that action at this time.
0 commit comments