$NetBSD: patch-ar,v 1.1 2004/09/07 22:14:09 salo Exp $

CVE: CAN-2004-0805

--- layer2.c.orig	1999-02-10 13:13:06.000000000 +0100
+++ layer2.c	2004-09-08 00:00:06.000000000 +0200
@@ -265,6 +265,12 @@
   fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ?
      (fr->mode_ext<<2)+4 : fr->II_sblimit;
 
+  if (fr->jsbound > fr->II_sblimit)
+  {
+    fprintf(stderr, "Truncating stereo boundary to sideband limit.\n");
+    fr->jsbound=fr->II_sblimit;
+  }
+
   if(stereo == 1 || single == 3)
     single = 0;
 
