summaryrefslogtreecommitdiff
path: root/libavcodec/tta.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-10 00:38:13 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-10 01:20:07 +0100
commit8c6ebab747ca8311b81ff4d0a7c17ef60b372f32 (patch)
tree677444f33cd2ee65df88809ca820ed57d2077ca3 /libavcodec/tta.c
parentea4037162fb0afa871e5312a7b23c828d2b85066 (diff)
parentc57fe49da8feda7d2e6c266978250a15a83e0484 (diff)
downloadffmpeg-8c6ebab747ca8311b81ff4d0a7c17ef60b372f32.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (26 commits) eac3dec: replace undefined 1<<31 with INT32_MIN in noise generation yadif: specify array size outside DECLARE_ALIGNED prores: specify array size outside DECLARE_ALIGNED brackets. WavPack demuxer: set packet duration tta: use skip_bits_long() mxfdec: Ignore the last entry in Avid's index table segments mxfdec: Sanity-check SampleRate mxfdec: Handle small EditUnitByteCount mxfdec: Consider OPAtom files that do not have exactly one EC to be OP1a mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index() mxfdec: Sanity check PreviousPartition mxfdec: Never seek back in local sets and KLVs mxfdec: Move the current_partition check inside mxf_read_header() mxfdec: Fix infinite loop in mxf_packet_timestamps() mxfdec: Check eof_reached in mxf_read_local_tags() mxfdec: Check for NULL component mxfdec: Make sure mxf->nb_index_tables > 0 in mxf_packet_timestamps() mxfdec: Make sure x < index_table->nb_ptses build: Add missing directories to DIRS declarations. ... Conflicts: doc/build_system.txt doc/fate.texi libavfilter/x86/yadif_template.c libavformat/mxfdec.c libavutil/Makefile tests/fate/audio.mak tests/fate/prores.mak tests/fate/screen.mak tests/fate/video.mak tests/ref/fate/bethsoft-vid tests/ref/fate/cscd tests/ref/fate/dfa4 tests/ref/fate/nuv tests/ref/fate/vp8-sign-bias tests/ref/fate/wmv8-drm tests/ref/lavf/gxf Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/tta.c')
-rw-r--r--libavcodec/tta.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 8d49bc80d2..ab83730dfd 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -201,7 +201,6 @@ static const int64_t tta_channel_layouts[7] = {
static av_cold int tta_decode_init(AVCodecContext * avctx)
{
TTAContext *s = avctx->priv_data;
- int i;
s->avctx = avctx;
@@ -213,7 +212,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
if (show_bits_long(&s->gb, 32) == AV_RL32("TTA1"))
{
/* signature */
- skip_bits(&s->gb, 32);
+ skip_bits_long(&s->gb, 32);
s->format = get_bits(&s->gb, 16);
if (s->format > 2) {
@@ -231,7 +230,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
s->bps = (avctx->bits_per_coded_sample + 7) / 8;
avctx->sample_rate = get_bits_long(&s->gb, 32);
s->data_length = get_bits_long(&s->gb, 32);
- skip_bits(&s->gb, 32); // CRC32 of header
+ skip_bits_long(&s->gb, 32); // CRC32 of header
if (s->channels == 0) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid number of channels\n");
@@ -272,9 +271,8 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
s->data_length, s->frame_length, s->last_frame_length, s->total_frames);
// FIXME: seek table
- for (i = 0; i < s->total_frames; i++)
- skip_bits(&s->gb, 32);
- skip_bits(&s->gb, 32); // CRC32 of seektable
+ skip_bits_long(&s->gb, 32 * s->total_frames);
+ skip_bits_long(&s->gb, 32); // CRC32 of seektable
if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){
av_log(avctx, AV_LOG_ERROR, "frame_length too large\n");
@@ -413,7 +411,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
if (get_bits_left(&s->gb) < 32)
return -1;
- skip_bits(&s->gb, 32); // frame crc
+ skip_bits_long(&s->gb, 32); // frame crc
// convert to output buffer
switch(s->bps) {