diff -ruN faad2-2.6.1-3.1/debian/changelog faad2-2.6.1-4/debian/changelog
--- faad2-2.6.1-3.1/debian/changelog	2009-05-29 01:18:07.000000000 +0100
+++ faad2-2.6.1-4/debian/changelog	2009-05-29 01:41:53.000000000 +0100
@@ -1,3 +1,13 @@
+faad2 (2.6.1-4) unstable; urgency=low
+
+  * Acknowledge NMU
+  * Update patch for heap overflow (#499899): use reasonable types and
+    provided "min" macro
+  * Add comments on creation of 99_autotools-regenerated (Closes: #503657)
+  * Add explanation of purpose and effects of 02_public_headers (Closes: #505901)
+
+ -- Matthew W. S. Bell <mentor@ibis.bells>  Fri, 29 May 2009 01:41:30 +0100
+
 faad2 (2.6.1-3.1) unstable; urgency=high
 
   * Non-maintainer upload by the security team
diff -ruN faad2-2.6.1-3.1/debian/patches/02_public-headers.dpatch faad2-2.6.1-4/debian/patches/02_public-headers.dpatch
--- faad2-2.6.1-3.1/debian/patches/02_public-headers.dpatch	2009-05-29 01:18:07.000000000 +0100
+++ faad2-2.6.1-4/debian/patches/02_public-headers.dpatch	2008-12-08 00:00:09.000000000 +0000
@@ -2,7 +2,11 @@
 ## 02_public-headers.dpatch by  <matthew@bells23.org.uk>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: Use the public headers directly internally
+## DP: Make the declaration and definition of function consistent. Note that
+## DP: this means the API differs from libfaad found elsewhere.
+## DP: This is achieved by including the public declarations in the library
+## DP: source. Conflicts in types were resolved by choosing the type in the
+## DP: definition.
 
 @DPATCH@
 diff -urNad faad2-svn~/include/neaacdec.h faad2-svn/include/neaacdec.h
diff -ruN faad2-2.6.1-3.1/debian/patches/12_heap_overflow.dpatch faad2-2.6.1-4/debian/patches/12_heap_overflow.dpatch
--- faad2-2.6.1-3.1/debian/patches/12_heap_overflow.dpatch	2009-05-29 01:18:07.000000000 +0100
+++ faad2-2.6.1-4/debian/patches/12_heap_overflow.dpatch	2009-05-29 01:28:55.000000000 +0100
@@ -1,21 +1,25 @@
 #! /bin/sh /usr/share/dpatch/dpatch-run
 
 @DPATCH@
---- faad2-2.6.1\faad2\frontend\main.c	2007-11-01 13:33:30.000000000 -0700
-+++ faad2-2.6.1/frontend/main.c	2008-09-16 11:01:40.000000000 -0700
-@@ -911,12 +911,14 @@
-             if (sampleId == 0) dur = 0;
+diff -urNad faad2-2.6.1-3.1~/frontend/main.c faad2-2.6.1-3.1/frontend/main.c
+--- faad2-2.6.1-3.1~/frontend/main.c	2008-11-16 22:50:30.000000000 +0000
++++ faad2-2.6.1-3.1/frontend/main.c	2008-11-16 22:58:12.000000000 +0000
+@@ -872,8 +872,7 @@
+     for (sampleId = 0; sampleId < numSamples; sampleId++)
+     {
+         int rc;
+-        long dur;
+-        unsigned int sample_count;
++        unsigned int dur, sample_count;
+         unsigned int delay = 0;
  
+         /* get acces unit from MP4 file */
+@@ -913,7 +912,7 @@
              if (useAacLength || (timescale != samplerate)) {
                  sample_count = frameInfo.samples;
              } else {
-                 sample_count = (unsigned int)(dur * frameInfo.channels);
-+                if (sample_count > frameInfo.samples)
-+                    sample_count = frameInfo.samples;
+-                sample_count = (unsigned int)(dur * frameInfo.channels);
++                sample_count = min(dur * frameInfo.channels, frameInfo.samples);
  
                  if (!useAacLength && !initial && (sampleId < numSamples/2) && (sample_count != frameInfo.samples))
                  {
-                     faad_fprintf(stderr, "MP4 seems to have incorrect frame duration, using values from AAC data.\n");
-                     useAacLength = 1;
-                     sample_count = frameInfo.samples;
-
diff -ruN faad2-2.6.1-3.1/debian/patches/99_autotools-regenerated.dpatch faad2-2.6.1-4/debian/patches/99_autotools-regenerated.dpatch
--- faad2-2.6.1-3.1/debian/patches/99_autotools-regenerated.dpatch	2009-05-29 01:18:07.000000000 +0100
+++ faad2-2.6.1-4/debian/patches/99_autotools-regenerated.dpatch	2009-05-29 01:45:59.000000000 +0100
@@ -2,7 +2,9 @@
 ## 99_autotools-regenerated.dpatch by  <matthew@bells23.org.uk>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
+## DP: This patch generated using dpatch-edit-patch and then running
+## DP: 'autoreconf -isf && rm -r autom4te.cache'
+
 
 @DPATCH@
 diff -urNad faad2-svn~/INSTALL faad2-svn/INSTALL
