~siretart/xine-lib/ubuntu

« back to all changes in this revision

Viewing changes to src/libfaad/structs.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-12-15 13:13:45 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051215131345-8n4osv1j7fy9c1s1
* SECURITY UPDATE: Fix arbitrary code execution with crafted PNG images in
  embedded ffmpeg copy.
* src/libffmpeg/libavcodec/utils.c, avcodec_default_get_buffer(): Apply
  upstream patch to fix buffer overflow on decoding of small PIX_FMT_PAL8
  PNG files.
* References:
  CVE-2005-4048
  http://mplayerhq.hu/pipermail/ffmpeg-devel/2005-November/005333.html
  http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/ffmpeg/libavcodec/
  utils.c.diff?r1=1.161&r2=1.162&cvsroot=FFMpeg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3
3
** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
4
 
**  
 
4
**
5
5
** This program is free software; you can redistribute it and/or modify
6
6
** it under the terms of the GNU General Public License as published by
7
7
** the Free Software Foundation; either version 2 of the License, or
8
8
** (at your option) any later version.
9
 
** 
 
9
**
10
10
** This program is distributed in the hope that it will be useful,
11
11
** but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
13
** GNU General Public License for more details.
14
 
** 
 
14
**
15
15
** You should have received a copy of the GNU General Public License
16
 
** along with this program; if not, write to the Free Software 
 
16
** along with this program; if not, write to the Free Software
17
17
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
18
**
19
19
** Any non-GPL usage of this software or parts of this software is strictly
22
22
** Commercial non-GPL licensing of this software is possible.
23
23
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
24
24
**
25
 
** $Id: structs.h,v 1.6 2004/12/03 01:15:31 tmattern Exp $
 
25
** $Id: structs.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
26
26
**/
27
27
 
28
28
#ifndef __STRUCTS_H__
77
77
#ifdef PROFILE
78
78
    int64_t cycles;
79
79
#endif
80
 
#ifdef USE_SSE
81
 
    void (*if_func)(void *a, uint8_t b, uint8_t c, uint8_t d, real_t *e, real_t *f, uint8_t g, uint16_t h);
82
 
#endif
83
80
} fb_info;
84
81
 
85
82
typedef struct
182
179
    program_config pce[16];
183
180
} adif_header;
184
181
 
 
182
#ifdef LTP_DEC
185
183
typedef struct
186
184
{
187
185
    uint8_t last_band;
194
192
    uint8_t short_lag_present[8];
195
193
    uint8_t short_lag[8];
196
194
} ltp_info;
 
195
#endif
197
196
 
 
197
#ifdef MAIN_DEC
198
198
typedef struct
199
199
{
200
200
    uint8_t limit;
202
202
    uint8_t predictor_reset_group_number;
203
203
    uint8_t prediction_used[MAX_SFB];
204
204
} pred_info;
 
205
#endif
205
206
 
206
207
typedef struct
207
208
{
268
269
 
269
270
    pulse_info pul;
270
271
    tns_info tns;
 
272
#ifdef MAIN_DEC
271
273
    pred_info pred;
 
274
#endif
 
275
#ifdef LTP_DEC
272
276
    ltp_info ltp;
273
277
    ltp_info ltp2;
 
278
#endif
274
279
#ifdef SSR_DEC
275
280
    ssr_info ssr;
276
281
#endif
292
297
 
293
298
typedef struct
294
299
{
295
 
    uint8_t ele_id;
296
 
 
297
300
    uint8_t channel;
298
301
    int16_t paired_channel;
299
302
 
307
310
typedef struct mp4AudioSpecificConfig
308
311
{
309
312
    /* Audio Specific Info */
310
 
    uint8_t objectTypeIndex;
311
 
    uint8_t samplingFrequencyIndex;
312
 
    uint32_t samplingFrequency;
313
 
    uint8_t channelsConfiguration;
 
313
    /*uint8_t*/ unsigned char objectTypeIndex;
 
314
    /*uint8_t*/ unsigned char samplingFrequencyIndex;
 
315
    /*uint32_t*/ unsigned long samplingFrequency;
 
316
    /*uint8_t*/ unsigned char channelsConfiguration;
314
317
 
315
318
    /* GA Specific Info */
316
 
    uint8_t frameLengthFlag;
317
 
    uint8_t dependsOnCoreCoder;
318
 
    uint16_t coreCoderDelay;
319
 
    uint8_t extensionFlag;
320
 
    uint8_t aacSectionDataResilienceFlag;
321
 
    uint8_t aacScalefactorDataResilienceFlag;
322
 
    uint8_t aacSpectralDataResilienceFlag;
323
 
    uint8_t epConfig;
 
319
    /*uint8_t*/ unsigned char frameLengthFlag;
 
320
    /*uint8_t*/ unsigned char dependsOnCoreCoder;
 
321
    /*uint16_t*/ unsigned short coreCoderDelay;
 
322
    /*uint8_t*/ unsigned char extensionFlag;
 
323
    /*uint8_t*/ unsigned char aacSectionDataResilienceFlag;
 
324
    /*uint8_t*/ unsigned char aacScalefactorDataResilienceFlag;
 
325
    /*uint8_t*/ unsigned char aacSpectralDataResilienceFlag;
 
326
    /*uint8_t*/ unsigned char epConfig;
324
327
 
325
 
    int8_t sbr_present_flag;
326
 
    int8_t forceUpSampling;
 
328
    /*uint8_t*/ char sbr_present_flag;
 
329
    /*uint8_t*/ char forceUpSampling;
 
330
    /*uint8_t*/ char downSampledSBR;
327
331
} mp4AudioSpecificConfig;
328
332
 
329
 
typedef struct faacDecConfiguration
 
333
typedef struct NeAACDecConfiguration
330
334
{
331
 
    uint8_t defObjectType;
332
 
    uint32_t defSampleRate;
333
 
    uint8_t outputFormat;
334
 
    uint8_t downMatrix;
335
 
    uint8_t useOldADTSFormat;
336
 
    uint8_t dontUpSampleImplicitSBR;
337
 
} faacDecConfiguration, *faacDecConfigurationPtr;
 
335
    /*uint8_t*/ unsigned char defObjectType;
 
336
    /*uint32_t*/ unsigned long defSampleRate;
 
337
    /*uint8_t*/ unsigned char outputFormat;
 
338
    /*uint8_t*/ unsigned char downMatrix;
 
339
    /*uint8_t*/ unsigned char useOldADTSFormat;
 
340
    /*uint8_t*/ unsigned char dontUpSampleImplicitSBR;
 
341
} NeAACDecConfiguration, *NeAACDecConfigurationPtr;
338
342
 
339
 
typedef struct faacDecFrameInfo
 
343
typedef struct NeAACDecFrameInfo
340
344
{
341
 
    uint32_t bytesconsumed;
342
 
    uint32_t samples;
343
 
    uint8_t channels;
344
 
    uint8_t error;
345
 
    uint32_t samplerate;
 
345
    /*uint32_t*/ unsigned long bytesconsumed;
 
346
    /*uint32_t*/ unsigned long samples;
 
347
    /*uint8_t*/ unsigned char channels;
 
348
    /*uint8_t*/ unsigned char error;
 
349
    /*uint32_t*/ unsigned long samplerate;
346
350
 
347
351
    /* SBR: 0: off, 1: on; normal, 2: on; downsampled */
348
 
    uint8_t sbr;
 
352
    /*uint8_t*/ unsigned char sbr;
349
353
 
350
354
    /* MPEG-4 ObjectType */
351
 
    uint8_t object_type;
 
355
    /*uint8_t*/ unsigned char object_type;
352
356
 
353
357
    /* AAC header type; MP4 will be signalled as RAW also */
354
 
    uint8_t header_type;
 
358
    /*uint8_t*/ unsigned char header_type;
355
359
 
356
360
    /* multichannel configuration */
357
 
    uint8_t num_front_channels;
358
 
    uint8_t num_side_channels;
359
 
    uint8_t num_back_channels;
360
 
    uint8_t num_lfe_channels;
361
 
    uint8_t channel_position[MAX_CHANNELS];
362
 
} faacDecFrameInfo;
 
361
    /*uint8_t*/ unsigned char num_front_channels;
 
362
    /*uint8_t*/ unsigned char num_side_channels;
 
363
    /*uint8_t*/ unsigned char num_back_channels;
 
364
    /*uint8_t*/ unsigned char num_lfe_channels;
 
365
    /*uint8_t*/ unsigned char channel_position[MAX_CHANNELS];
 
366
 
 
367
    /* PS: 0: off, 1: on */
 
368
    /*uint8_t*/ unsigned char ps;
 
369
} NeAACDecFrameInfo;
363
370
 
364
371
typedef struct
365
372
{
379
386
    uint32_t frame;
380
387
 
381
388
    uint8_t downMatrix;
 
389
    uint8_t upMatrix;
382
390
    uint8_t first_syn_ele;
383
391
    uint8_t has_lfe;
384
392
    /* number of channels in current frame */
415
423
#ifdef SBR_DEC
416
424
    int8_t sbr_present_flag;
417
425
    int8_t forceUpSampling;
 
426
    int8_t downSampledSBR;
418
427
    /* determines whether SBR data is allocated for the gives element */
419
428
    uint8_t sbr_alloced[MAX_SYNTAX_ELEMENTS];
420
429
 
421
430
    sbr_info *sbr[MAX_SYNTAX_ELEMENTS];
422
 
#ifdef DRM
423
 
    int8_t lcstereo_flag;
424
 
#endif
425
431
#endif
426
432
#if (defined(PS_DEC) || defined(DRM_PS))
427
433
    uint8_t ps_used[MAX_SYNTAX_ELEMENTS];
 
434
    uint8_t ps_used_global;
428
435
#endif
429
436
 
430
437
#ifdef SSR_DEC
447
454
    uint8_t internal_channel[MAX_CHANNELS];
448
455
 
449
456
    /* Configuration data */
450
 
    faacDecConfiguration config;
451
 
 
452
 
#ifdef USE_SSE
453
 
    void (*apply_sf_func)(void *a, void *b, void *c, uint16_t d);
454
 
#endif
 
457
    NeAACDecConfiguration config;
455
458
 
456
459
#ifdef PROFILE
457
460
    int64_t cycles;
460
463
    int64_t scalefac_cycles;
461
464
    int64_t requant_cycles;
462
465
#endif
463
 
} faacDecStruct, *faacDecHandle;
 
466
} NeAACDecStruct, *NeAACDecHandle;
464
467
 
465
468
 
466
469