summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2007-10-14 13:27:01 +0000
committerMagnus Holmgren <magnushol@gmail.com>2007-10-14 13:27:01 +0000
commit9146f20ea2642b9d685e75aa6e2282000b0b994c (patch)
treeb1bce044b17c1a7d374440f251bcbac53025e261
parentd777a367ada03574d5f1dbc0428d828cf0f582b6 (diff)
downloadrockbox-9146f20ea2642b9d685e75aa6e2282000b0b994c.tar.gz
rockbox-9146f20ea2642b9d685e75aa6e2282000b0b994c.tar.bz2
rockbox-9146f20ea2642b9d685e75aa6e2282000b0b994c.zip
MP4 tag parser: guard against problems when the buffer is full.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15105 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/metadata/mp4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c
index 4a1fba11c2..31c9509b94 100644
--- a/apps/metadata/mp4.c
+++ b/apps/metadata/mp4.c
@@ -109,7 +109,7 @@ static unsigned int read_mp4_tag_string(int fd, int size_left, char** buffer,
unsigned int* buffer_left, char** dest)
{
unsigned int bytes_read = read_mp4_tag(fd, size_left, *buffer,
- *buffer_left - 1);
+ *buffer_left > 0 ? *buffer_left - 1 : 0);
unsigned int length = 0;
if (bytes_read)