Skip to content

Instantly share code, notes, and snippets.

@khenriks
Created February 1, 2012 00:46
Show Gist options
  • Save khenriks/1714247 to your computer and use it in GitHub Desktop.
Save khenriks/1714247 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Feb 1, 2012.
    15 changes: 15 additions & 0 deletions mp3fs5.patch
    Original 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;
    }