~ubuntu-branches/ubuntu/hardy/ffmpeg/hardy

« back to all changes in this revision

Viewing changes to libavcodec/tta.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-08-23 14:35:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060823143552-8fxnur5b9gesr03m
Tags: 3:0.cvs20060823-0ubuntu1
* Sync with Debian:
  + Add the epoch again

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 *
15
15
 * You should have received a copy of the GNU Lesser General Public
16
16
 * License along with this library; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
20
/**
238
238
        avctx->bits_per_sample = get_le16(&s->gb);
239
239
        s->bps = (avctx->bits_per_sample + 7) / 8;
240
240
        avctx->sample_rate = get_le32(&s->gb);
 
241
        if(avctx->sample_rate > 1000000){ //prevent FRAME_TIME * avctx->sample_rate from overflowing and sanity check
 
242
            av_log(avctx, AV_LOG_ERROR, "sample_rate too large\n");
 
243
            return -1;
 
244
        }
241
245
        s->data_length = get_le32(&s->gb);
242
246
        skip_bits(&s->gb, 32); // CRC32 of header
243
247
 
276
280
            skip_bits(&s->gb, 32);
277
281
        skip_bits(&s->gb, 32); // CRC32 of seektable
278
282
 
 
283
        if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){
 
284
            av_log(avctx, AV_LOG_ERROR, "frame_length too large\n");
 
285
            return -1;
 
286
        }
 
287
 
279
288
        s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels);
280
289
    } else {
281
290
        av_log(avctx, AV_LOG_ERROR, "Wrong extradata present\n");