]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/amrnbdata.h
libopusdec: fix out-of-bounds read
[ffmpeg] / libavcodec / amrnbdata.h
index 2f21439896adb7e9f3189cfa22d9f9a6a5217e65..b7d1b8960898d5b41631d59ab244102d3dc87f3e 100644 (file)
@@ -3,20 +3,20 @@
  * Copyright (c) 2006-2007 Robert Swain
  * Copyright (c) 2009 Colin McQuillan
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -55,7 +55,7 @@ enum Mode {
 /**
  * AMRNB unpacked data subframe
  */
-typedef struct {
+typedef struct AMRNBSubframe {
     uint16_t p_lag;      ///< index to decode the pitch lag
     uint16_t p_gain;     ///< index to decode the pitch gain
     uint16_t fixed_gain; ///< index to decode the fixed gain factor, for MODE_12k2 and MODE_7k95
@@ -65,13 +65,13 @@ typedef struct {
 /**
  * AMRNB unpacked data frame
  */
-typedef struct {
+typedef struct AMRNBFrame {
     uint16_t lsf[5];           ///< lsf parameters: 5 parameters for MODE_12k2, only 3 for other modes
     AMRNBSubframe subframe[4]; ///< unpacked data for each subframe
 } AMRNBFrame;
 
 /** The index of a frame parameter */
-#define AMR_BIT(field)                  (offsetof(AMRNBFrame, field) >> 1)
+#define AMR_BIT(field)                  (offsetof(AMRNBFrame, field))
 /** The index of a subframe-specific parameter */
 #define AMR_OF(frame_num, variable)     AMR_BIT(subframe[frame_num].variable)
 
@@ -1669,4 +1669,3 @@ static const float highpass_poles[2] = { -1.933105469, 0.935913085 };
 static const float highpass_gain     = 0.939819335;
 
 #endif /* AVCODEC_AMRNBDATA_H */
-