From 9c5f25049189530aa7ef9a0fc3444bbb22126f49 Mon Sep 17 00:00:00 2001 From: learman Date: Sun, 14 Oct 2007 13:27:01 +0000 Subject: [PATCH] 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 --- apps/metadata/mp4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c index 4a1fba11c..31c9509b9 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) -- 2.11.4.GIT