Browse Source

redo lost stb_vorbis fixes

Sean Barrett 7 years ago
parent
commit
663deb3a43
1 changed files with 3 additions and 3 deletions
  1. 3 3
      stb_vorbis.c

+ 3 - 3
stb_vorbis.c

@@ -1,4 +1,4 @@
-// Ogg Vorbis audio decoder - v1.13 - public domain
+// Ogg Vorbis audio decoder - v1.13b - public domain
 // http://nothings.org/stb_vorbis/
 // http://nothings.org/stb_vorbis/
 //
 //
 // Original version written by Sean Barrett in 2007.
 // Original version written by Sean Barrett in 2007.
@@ -3398,7 +3398,7 @@ static int vorbis_decode_packet_rest(vorb *f, int *len, Mode *m, int left_start,
    if (f->last_seg_which == f->end_seg_with_known_loc) {
    if (f->last_seg_which == f->end_seg_with_known_loc) {
       // if we have a valid current loc, and this is final:
       // if we have a valid current loc, and this is final:
       if (f->current_loc_valid && (f->page_flag & PAGEFLAG_last_page)) {
       if (f->current_loc_valid && (f->page_flag & PAGEFLAG_last_page)) {
-         uint32 current_end = f->known_loc_for_packet - (n-right_end);
+         uint32 current_end = f->known_loc_for_packet;
          // then let's infer the size of the (probably) short final frame
          // then let's infer the size of the (probably) short final frame
          if (current_end < f->current_loc + (right_end-left_start)) {
          if (current_end < f->current_loc + (right_end-left_start)) {
             if (current_end < f->current_loc) {
             if (current_end < f->current_loc) {
@@ -3407,7 +3407,7 @@ static int vorbis_decode_packet_rest(vorb *f, int *len, Mode *m, int left_start,
             } else {
             } else {
                *len = current_end - f->current_loc;
                *len = current_end - f->current_loc;
             }
             }
-            *len += left_start;
+            *len += left_start; // this doesn't seem right, but has no ill effect on my test files
             if (*len > right_end) *len = right_end; // this should never happen
             if (*len > right_end) *len = right_end; // this should never happen
             f->current_loc += *len;
             f->current_loc += *len;
             return TRUE;
             return TRUE;