Created
February 1, 2012 00:46
-
-
Save khenriks/1714247 to your computer and use it in GitHub Desktop.
Patch to fix mp3fs #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/transcode.c b/src/transcode.c | |
index 13cbf73..bccd7d0 100644 | |
--- a/src/transcode.c | |
+++ b/src/transcode.c | |
@@ -499,6 +499,10 @@ trans_fail: | |
/* Read some bytes into the internal buffer and into the given buffer. */ | |
int transcoder_read(struct transcoder* trans, char* buff, int offset, int len) { | |
+ /* Client asked for more data than exists. */ | |
+ if (offset > trans->totalsize) { | |
+ return 0; | |
+ } | |
if (offset+len > trans->totalsize) { | |
len = trans->totalsize - offset; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment