Skip to content

Commit 82fa08e

Browse files
authored
decoder: return early when the object type can't be supported (#233)
No need to allocate a filter bank that will not be used (and may leak).
1 parent 692a35c commit 82fa08e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

libfaad/decoder.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ long NeAACDecInit(NeAACDecHandle hpDecoder,
372372
}
373373
#endif
374374

375+
if (can_decode_ot(hDecoder->object_type) < 0)
376+
return -1;
377+
375378
/* must be done before frameLength is divided by 2 for LD */
376379
#ifdef SSR_DEC
377380
if (hDecoder->object_type == SSR)
@@ -385,9 +388,6 @@ long NeAACDecInit(NeAACDecHandle hpDecoder,
385388
hDecoder->frameLength >>= 1;
386389
#endif
387390

388-
if (can_decode_ot(hDecoder->object_type) < 0)
389-
return -1;
390-
391391
return bits;
392392
}
393393

0 commit comments

Comments
 (0)