summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-08-14 09:49:09 +0000
committerMohamed Tarek <mt@rockbox.org>2010-08-14 09:49:09 +0000
commitafe92f34cc58ee4da010db20cba71f5a6232ea81 (patch)
treebff3c8048ebe9397144e18dca25bae0743228e8a
parent56229d58662326e1f75292aab32cf44cd82c50ba (diff)
downloadrockbox-afe92f34cc58ee4da010db20cba71f5a6232ea81.tar.gz
rockbox-afe92f34cc58ee4da010db20cba71f5a6232ea81.zip
Correct the check for the requested vs returned sizes in libasf.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27807 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libasf/asf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/codecs/libasf/asf.c b/apps/codecs/libasf/asf.c
index ce416689da..a7e4bca307 100644
--- a/apps/codecs/libasf/asf.c
+++ b/apps/codecs/libasf/asf.c
@@ -191,7 +191,8 @@ int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength,
buf = ci->request_buffer(&bufsize, length);
datap = buf;
- if (bufsize > length) {
+#define ASF_MAX_REQUEST (1L<<15) /* 32KB */
+ if (bufsize != length && length >= ASF_MAX_REQUEST) {
/* This should only happen with packets larger than 32KB (the
guard buffer size). All the streams I've seen have
relatively small packets less than about 8KB), but I don't