diff options
Diffstat (limited to 'codebook.c')
-rw-r--r-- | codebook.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -25,9 +25,9 @@ /* unpacks a codebook from the packet buffer into the codebook struct, readies the codebook auxiliary structures for decode *************/ -int vorbis_staticbook_unpack(oggpack_buffer *opb,static_codebook *s){ +static_codebook *vorbis_staticbook_unpack(oggpack_buffer *opb){ long i,j; - memset(s,0,sizeof(*s)); + static_codebook *s=_ogg_calloc(1,sizeof(*s)); /* make sure alignment is correct */ if(oggpack_read(opb,24)!=0x564342)goto _eofout; @@ -85,7 +85,7 @@ int vorbis_staticbook_unpack(oggpack_buffer *opb,static_codebook *s){ break; default: /* EOF */ - return(-1); + goto _eofout; } /* Do we have a mapping to unpack? */ @@ -127,12 +127,12 @@ int vorbis_staticbook_unpack(oggpack_buffer *opb,static_codebook *s){ } /* all set */ - return(0); + return(s); _errout: _eofout: - vorbis_staticbook_clear(s); - return(-1); + vorbis_staticbook_destroy(s); + return(NULL); } /* the 'eliminate the decode tree' optimization actually requires the |