From 9146f20ea2642b9d685e75aa6e2282000b0b994c Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sun, 14 Oct 2007 13:27:01 +0000 Subject: 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(-) (limited to 'apps/metadata/mp4.c') 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) -- cgit v1.2.3