]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/atrac3.c
fft-test: add option to set cpuflag mask
[ffmpeg] / libavcodec / atrac3.c
index fd036e720ab4f656c184db8c8656c858b1dad4d2..f468f11065547aaa98ac33f445596cda676ca11e 100644 (file)
@@ -402,6 +402,8 @@ static int decodeTonalComponents (GetBitContext *gb, tonal_component *pComponent
 
             for (k=0; k<coded_components; k++) {
                 sfIndx = get_bits(gb,6);
+                if (component_count >= 64)
+                    return AVERROR_INVALIDDATA;
                 pComponent[component_count].pos = j * 64 + (get_bits(gb,6));
                 max_coded_values = SAMPLES_PER_FRAME - pComponent[component_count].pos;
                 coded_values = coded_values_per_component + 1;
@@ -1064,13 +1066,13 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
 
 AVCodec ff_atrac3_decoder =
 {
-    .name = "atrac3",
-    .type = AVMEDIA_TYPE_AUDIO,
-    .id = CODEC_ID_ATRAC3,
+    .name           = "atrac3",
+    .type           = AVMEDIA_TYPE_AUDIO,
+    .id             = CODEC_ID_ATRAC3,
     .priv_data_size = sizeof(ATRAC3Context),
-    .init = atrac3_decode_init,
-    .close = atrac3_decode_close,
-    .decode = atrac3_decode_frame,
-    .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
-    .long_name = NULL_IF_CONFIG_SMALL("Atrac 3 (Adaptive TRansform Acoustic Coding 3)"),
+    .init           = atrac3_decode_init,
+    .close          = atrac3_decode_close,
+    .decode         = atrac3_decode_frame,
+    .capabilities   = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
+    .long_name      = NULL_IF_CONFIG_SMALL("Atrac 3 (Adaptive TRansform Acoustic Coding 3)"),
 };