# HG changeset patch # User reimar # Date 1289643814 0 # Node ID 187f26cba0ceb83f6bf9a3f418bfd124e47ccf22 # Parent 6320065226a6e67fe5548fa5682a9c987a356c21 If audio_block_size is 0 that is a bug (and will result in a division by 0 in one case that does not check this), thus remove all checks for it. diff -r 6320065226a6 -r 187f26cba0ce libmpdemux/demux_avi.c --- a/libmpdemux/demux_avi.c Sat Nov 13 10:17:13 2010 +0000 +++ b/libmpdemux/demux_avi.c Sat Nov 13 10:23:34 2010 +0000 @@ -159,8 +159,8 @@ pts=priv->avi_audio_pts; //+priv->pts_correction; priv->avi_audio_pts=0; // update blockcount: - priv->audio_block_no+=priv->audio_block_size ? - ((len+priv->audio_block_size-1)/priv->audio_block_size) : 1; + priv->audio_block_no+= + (len+priv->audio_block_size-1)/priv->audio_block_size; } else if(ds==demux->video){ // video @@ -687,8 +687,8 @@ break; } ++d_audio->pack_no; - priv->audio_block_no+=priv->audio_block_size ? - ((len+priv->audio_block_size-1)/priv->audio_block_size) : 1; + priv->audio_block_no+= + (len+priv->audio_block_size-1)/priv->audio_block_size; d_audio->dpos+=len; } } @@ -713,12 +713,11 @@ skip_audio_bytes+=len; } else { ++d_audio->pack_no; - priv->audio_block_no+=priv->audio_block_size ? - ((len+priv->audio_block_size-1)/priv->audio_block_size) : 1; + priv->audio_block_no+= + (len+priv->audio_block_size-1)/priv->audio_block_size; d_audio->dpos+=len; audio_chunk_pos=i; } - if(priv->audio_block_size) chunks-=(len+priv->audio_block_size-1)/priv->audio_block_size; } }