src/alac.c : Fix calculated frame count for files with zero block count.

This commit is contained in:
Erik de Castro Lopo 2012-03-17 22:48:48 +11:00
parent 5e10b3ccdf
commit aeea6cac0f
2 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,9 @@
Add improved handling of custom chunk getting and settings. Set of patches
from IOhannes m zmoelnig submitted via github pull request #6.
* src/alac.c
Fix calculated frame count for files with zero block length.
2012-02-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/avr.c

View File

@ -373,6 +373,9 @@ alac_reader_calc_frames (SF_PRIVATE *psf, ALAC_PRIVATE *plac)
blocks = current_pos > 0 ? blocks + 1 : blocks ;
} ;
if (blocks == 0)
return 0 ;
/* Only count full blocks. */
frames = plac->frames_per_block * (blocks - 1) ;