[vlc-commits] [Git][videolan/vlc][master] 2 commits: contrib: faad2: add some sanity checks
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Aug 9 09:39:28 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
41e6d6f8 by Steve Lhomme at 2026-08-09T09:08:16+00:00
contrib: faad2: add some sanity checks
Fixes #29893
- - - - -
7bcce234 by Steve Lhomme at 2026-08-09T09:08:16+00:00
contrib: faad2: do not allocated a filter bank when we won't use it
Fixes #29894
- - - - -
3 changed files:
- + contrib/src/faad2/0001-decoder-return-early-when-the-object-type-can-t-be-s.patch
- + contrib/src/faad2/0001-specrec-check-the-last-swb_offset-value-is-valid.patch
- contrib/src/faad2/rules.mak
Changes:
=====================================
contrib/src/faad2/0001-decoder-return-early-when-the-object-type-can-t-be-s.patch
=====================================
@@ -0,0 +1,37 @@
+From 71e7b0e0c0ccb927af63c2a881958201aebe27de Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 6 Aug 2026 10:06:17 +0200
+Subject: [PATCH] decoder: return early when the object type can't be supported
+
+No need to allocate a filter bank that will not be used (and may leak).
+---
+ libfaad/decoder.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libfaad/decoder.c b/libfaad/decoder.c
+index de3b169..cd7ad10 100644
+--- a/libfaad/decoder.c
++++ b/libfaad/decoder.c
+@@ -372,6 +372,9 @@ long NeAACDecInit(NeAACDecHandle hpDecoder,
+ }
+ #endif
+
++ if (can_decode_ot(hDecoder->object_type) < 0)
++ return -1;
++
+ /* must be done before frameLength is divided by 2 for LD */
+ #ifdef SSR_DEC
+ if (hDecoder->object_type == SSR)
+@@ -385,9 +388,6 @@ long NeAACDecInit(NeAACDecHandle hpDecoder,
+ hDecoder->frameLength >>= 1;
+ #endif
+
+- if (can_decode_ot(hDecoder->object_type) < 0)
+- return -1;
+-
+ return bits;
+ }
+
+--
+2.52.0.windows.1
+
=====================================
contrib/src/faad2/0001-specrec-check-the-last-swb_offset-value-is-valid.patch
=====================================
@@ -0,0 +1,28 @@
+From 44e0e0abc77d2fccf97de9cbb3740bc6bb56ba36 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 6 Aug 2026 08:01:23 +0200
+Subject: [PATCH] specrec: check the last swb_offset value is valid
+
+It comes from hDecoder->frameLength and must be at least equal or greater to the
+value before it.
+---
+ libfaad/specrec.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libfaad/specrec.c b/libfaad/specrec.c
+index 9b1da2f..d53b4e0 100644
+--- a/libfaad/specrec.c
++++ b/libfaad/specrec.c
+@@ -372,6 +372,9 @@ uint8_t window_grouping_info(NeAACDecStruct *hDecoder, ic_stream *ics)
+ #ifdef LD_DEC
+ }
+ #endif
++ if (ics->num_swb > 0 && ics->swb_offset[ics->num_swb] < ics->swb_offset[ics->num_swb-1]) {
++ return 32;
++ }
+ return 0;
+ case EIGHT_SHORT_SEQUENCE:
+ ics->num_windows = 8;
+--
+2.52.0.windows.1
+
=====================================
contrib/src/faad2/rules.mak
=====================================
@@ -20,6 +20,8 @@ faad2: faad2-$(FAAD2_VERSION).tar.gz .sum-faad2
ifndef HAVE_FPU
$(APPLY) $(SRC)/faad2/faad2-fixed.patch
endif
+ $(APPLY) $(SRC)/faad2/0001-specrec-check-the-last-swb_offset-value-is-valid.patch
+ $(APPLY) $(SRC)/faad2/0001-decoder-return-early-when-the-object-type-can-t-be-s.patch
$(call pkg_static,"libfaad/faad2.pc.in")
$(MOVE)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b45afaa05496100deb809b009b9b4acb69aba82f...7bcce234171d386994edbc2d9e482b0d0f73e038
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b45afaa05496100deb809b009b9b4acb69aba82f...7bcce234171d386994edbc2d9e482b0d0f73e038
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list