summaryrefslogtreecommitdiff
path: root/audio/faad2/main_overflow.diff
blob: b501cd004840fae4152779ea653bb3e353bfe341 (plain)
1
2
3
4
5
6
7
8
9
10
11
--- faad2/frontend/main.c.orig	2007-11-01 13:33:29.000000000 +0100
+++ faad2/frontend/main.c	2008-10-02 00:13:21.000000000 +0200
@@ -914,6 +914,8 @@
                 sample_count = frameInfo.samples;
             } else {
                 sample_count = (unsigned int)(dur * frameInfo.channels);
+                if (sample_count > frameInfo.samples)
+                    sample_count = frameInfo.samples;
 
                 if (!useAacLength && !initial && (sampleId < numSamples/2) && (sample_count != frameInfo.samples))
                 {