Created
February 1, 2012 00:46
-
-
Save khenriks/1714247 to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ 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; }