]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ac3enc_float.c
paf: prevent invalid write
[ffmpeg] / libavcodec / ac3enc_float.c
index 1fc8c3625e7c05d0e2d1ee8389f1976f55537108..5afe0fe2aba30fceae9a1fdc25c09e7613d8c60d 100644 (file)
 #if CONFIG_AC3_ENCODER
 #define AC3ENC_TYPE AC3ENC_TYPE_AC3
 #include "ac3enc_opts_template.c"
-static const AVClass ac3enc_class = { "AC-3 Encoder", av_default_item_name,
-                                      ac3_options, LIBAVUTIL_VERSION_INT };
+static const AVClass ac3enc_class = {
+    .class_name = "AC-3 Encoder",
+    .item_name  = av_default_item_name,
+    .option     = ac3_options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
 #endif
 
 #include "ac3enc_template.c"
@@ -86,10 +90,12 @@ av_cold int ff_ac3_float_mdct_init(AC3EncodeContext *s)
 /*
  * Apply KBD window to input samples prior to MDCT.
  */
-static void apply_window(DSPContext *dsp, float *output, const float *input,
-                         const float *window, unsigned int len)
+static void apply_window(void *dsp, float *output,
+                         const float *input, const float *window,
+                         unsigned int len)
 {
-    dsp->vector_fmul(output, input, window, len);
+    AVFloatDSPContext *fdsp = dsp;
+    fdsp->vector_fmul(output, input, window, len);
 }
 
 
@@ -147,7 +153,7 @@ static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
 AVCodec ff_ac3_encoder = {
     .name            = "ac3",
     .type            = AVMEDIA_TYPE_AUDIO,
-    .id              = CODEC_ID_AC3,
+    .id              = AV_CODEC_ID_AC3,
     .priv_data_size  = sizeof(AC3EncodeContext),
     .init            = ff_ac3_encode_init,
     .encode2         = ff_ac3_float_encode_frame,