Codebase list faad2 / d8e7b30
New upstream version 2.9.2 Fabian Greffrath 3 years ago
15 changed file(s) with 109 addition(s) and 58 deletion(s). Raw diff Collapse all Expand all
1717 project/msvc/intermediate/
1818 libfaad/win32_ver.h
1919 *.user
20 /libfaad/faad2.pc
0 2.9.2:
1 [ Michał Janiszewski ]
2 * Only use x86-assembly when explicitly on x86
3 * Use unsigned integers correctly
4 * Initialize pointers that might otherwise not be
5
6 [ Fabian Greffrath ]
7 * update README esp. WRT directory structure
8
9 [ Rosen Penev ]
10 * fix compilation without SBR/PS_DEC (#48)
11 * fix compilation with LC_ONLY_DECODER (#47)
12
13 [ Fabian Greffrath ]
14 * fix "inline function 'cfftf1' declared but never defined" compiler warning
15 * fix some inconsistencies in the frontend output
16 * mp4read_open: add check for failed frame buffer allocation
17 * stszin: add check for allocation error and integer overflow
18 * add a pkg-config file
19
20 [ Stefan Pöschel ]
21 * frontend: address compile warning + add missing LF (#50)
22
23 [ François Cartegnie ]
24 * library name is faad (#52)
25 * Unbreak PS audio (#51)
26
027 2.9.1:
128 [ Fabian Greffrath ]
229 * Include stdio.h in libfaad/ps_dec.c for stderr (Michael Fink)
4747 ACTIONS!
4848
4949
50 ______
51 PEOPLE
52
53 FAAD2 is written by:
54 - M. Bakker (mbakker(at)nero.com).
55
56
57 _______________
58 VERSION HISTORY
59
60 Sorry, try building a ChangeLog from CVS.
61
6250 ___________________
6351 DIRECTORY STRUCTURE
6452
6553 faad2 - top level directory.
6654
67 aacDECdrop - windows decoder/player with drag'n'drop functionality
55 aacDECdrop - windows decoder/player with drag'n'drop functionality.
6856
69 common - generally used libraries and code.
57 docs - API documentation.
7058
71 faad - general common functions like filereading and streaming
72 as well as getting info from aac files.
73
74 mp4ff - Small MP4 file format library (includes tagging abilities).
75
7659 frontend - command line frontend to the FAAD2 library, also supports
7760 MPEG-4 file decoding.
7861
7962 include - inlude file for the FAAD2 library.
8063
8164 libfaad - the FAAD2 AAC decoder library including SBR.
82
83 codebook - Huffman codebooks
65
66 codebook - Huffman codebooks.
8467
8568 plugins - plugins for all kinds of pograms.
86
87 in_mp4 - winamp MPEG-4 AAC file input plugin.
88
69
70 mpeg4ip - plugin for the mpeg4ip player.
71
8972 QCD - Quintessential player AAC plugin.
9073
9174 QCDMp4 - Quintessential player MP4 plugin.
9275
93 xmms - xmms AAC plugin
76 xmms - xmms AAC plugin.
9477
95 mpeg4ip - plugin for the mpeg4ip player
78 project/msvc - Visual Studio 2017 project files.
9679
80 utils/win32 - generate "win32_ver.h" from "configure.h".
77 dnl - mpeg4ip plugin (requires mpeg4ip's libmp4v2 to be installed)
88
99 AC_PREREQ(2.50)
10 AC_INIT(faad2, 2.9.1)
10 AC_INIT(faad2, 2.9.2)
1111 AC_CONFIG_AUX_DIR(.)
1212 AM_INIT_AUTOMAKE([subdir-objects])
1313
158158 fi
159159
160160 AC_CONFIG_FILES(libfaad/Makefile)
161 AC_CONFIG_FILES(libfaad/faad2.pc)
161162 AC_CONFIG_FILES(plugins/Makefile)
162163 AC_CONFIG_FILES(plugins/xmms/Makefile)
163164 AC_CONFIG_FILES(plugins/xmms/src/Makefile)
461461 unsigned char channels;
462462 void *sample_buffer;
463463
464 audio_file *aufile;
465
466 FILE *adtsFile;
464 audio_file *aufile = NULL;
465
466 FILE *adtsFile = NULL;
467467 unsigned char *adtsData;
468468 int adtsDataSize;
469469
795795
796796 long sampleId, startSampleId;
797797
798 audio_file *aufile;
799
800 FILE *adtsFile;
798 audio_file *aufile = NULL;
799
800 FILE *adtsFile = NULL;
801801 unsigned char *adtsData;
802802 int adtsDataSize;
803803
10461046 char *adtsFileName = NULL;
10471047 float seekTo = 0;
10481048 unsigned char header[8];
1049 int bread;
10491050 float length = 0;
10501051 FILE *hMP4File;
10511052 char *faad_id_string;
12991300 }
13001301 }
13011302
1302 fread(header, 1, 8, hMP4File);
1303 bread = fread(header, 1, 8, hMP4File);
13031304
13041305 if (! readFromStdin )
13051306 fclose(hMP4File);
13061307
1308 if (bread != 8) {
1309 faad_fprintf(stderr, "Error reading file.\n");
1310 return 1;
1311 }
1312
13071313 if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p')
13081314 mp4file = 1;
13091315
13101316 if (!mp4file && seekTo != 0) {
1311 faad_fprintf(stderr, "Warning: can only seek in MP4 files");
1317 faad_fprintf(stderr, "Warning: can only seek in MP4 files\n");
13121318 }
13131319
13141320 if (mp4file)
13501356 float dec_length = (float)(clock() - begin)/(float)CLOCKS_PER_SEC;
13511357 #endif
13521358 faad_fprintf(stderr, "Decoding %s took: %5.2f sec. %5.2fx real-time.\n", aacFileName,
1353 dec_length, length/dec_length);
1359 dec_length, (dec_length > 0.01) ? (length/dec_length) : 0.);
13541360 }
13551361
13561362 if (aacFileName != NULL)
342342 u32in();
343343 // Number of entries
344344 mp4config.frame.ents = u32in();
345 // fixme error checking
346345 // fixme: check atom size
347346 mp4config.frame.data = malloc(sizeof(*mp4config.frame.data)
348347 * (mp4config.frame.ents + 1));
348
349 if (!mp4config.frame.data)
350 return ERR_FAIL;
351
349352 ofs = 0;
350353 mp4config.frame.data[0] = ofs;
351354 for (cnt = 0; cnt < mp4config.frame.ents; cnt++)
357360 mp4config.frame.maxsize = fsize;
358361
359362 mp4config.frame.data[cnt + 1] = ofs;
363
364 if (ofs < mp4config.frame.data[cnt])
365 return ERR_FAIL;
360366 }
361367
362368 return size;
950956
951957 static void mp4info(void)
952958 {
953 fprintf(stderr, "Modification Time:\t\t%s", mp4time(mp4config.mtime));
959 fprintf(stderr, "Modification Time:\t\t%s\n", mp4time(mp4config.mtime));
954960 fprintf(stderr, "Samplerate:\t\t%d\n", mp4config.samplerate);
955961 fprintf(stderr, "Total samples:\t\t%d\n", mp4config.samples);
956962 fprintf(stderr, "Total channels:\t\t%d\n", mp4config.channels);
10011007 }
10021008
10031009 // alloc frame buffer
1004 // fixme: error checking
10051010 mp4config.bitbuf.data = malloc(mp4config.frame.maxsize);
1011
1012 if (!mp4config.bitbuf.data)
1013 goto err;
10061014
10071015 if (mp4config.verbose.header)
10081016 {
3131
3232 libfaad_drm_la_LDFLAGS = ${libfaad_la_LDFLAGS}
3333 libfaad_drm_la_LIBADD = ${libfaad_la_LIBADD}
34 libfaad_drm_la_CFLAGS = ${libfaad_la_CFLAGS} -DDRM -DDRM_PS
34 libfaad_drm_la_CFLAGS = ${libfaad_la_CFLAGS} -DDRM_SUPPORT
3535 libfaad_drm_la_SOURCES = ${libfaad_la_SOURCES}
36
37 pkgconfigdir = $(libdir)/pkgconfig
38 pkgconfig_DATA = faad2.pc
39
40 EXTRA_DIST = faad2.pc.in
5959 static void passf5(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
6060 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3,
6161 const complex_t *wa4, const int8_t isign);
62 INLINE void cfftf1(uint16_t n, complex_t *c, complex_t *ch,
63 const uint16_t *ifac, const complex_t *wa, const int8_t isign);
6462 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac);
6563
6664
9090 /* Allow decoding of LD profile AAC */
9191 #define LD_DEC
9292 /* Allow decoding of Digital Radio Mondiale (DRM) */
93 //#define DRM
94 //#define DRM_PS
93 #ifdef DRM_SUPPORT
94 #define DRM
95 #define DRM_PS
96 #endif
9597
9698 /* LD can't do without LTP */
9799 #ifdef LD_DEC
114116 #undef MAIN_DEC
115117 #undef SSR_DEC
116118 #undef DRM
119 #undef DRM_PS
117120 #undef ALLOW_SMALL_FRAMELENGTH
118121 #undef ERROR_RESILIENCE
119122 #endif
312315 }
313316
314317
315 #if defined(_WIN32) && !defined(_WIN64) && !defined(__MINGW32__)
318 #if defined(_WIN32) && defined(_M_IX86) && !defined(__MINGW32__)
316319 #ifndef HAVE_LRINTF
317320 #define HAS_LRINTF
318321 static INLINE int lrintf(float f)
238238 while (ld->bytes_left)
239239 {
240240 bits = faad_latm_frame(latm, ld);
241 if(bits==-1U)
241 if(bits==0xFFFFFFFF)
242242 bad++;
243243 else
244244 {
0 prefix=@prefix@
1 exec_prefix=@exec_prefix@
2 libdir=@libdir@
3 includedir=@includedir@
4
5 Name: FAAD2
6 Description: Freeware Advanced Audio (AAC) Decoder
7 Version: @VERSION@
8 Libs: -L${libdir} -lfaad
9 Libs.private: -lm
10 Cflags: -I${includedir}
3232
3333 #include <stdlib.h>
3434
35 #include "bits.h"
3635 #include "mp4.h"
3736 #include "syntax.h"
3837
3434 extern "C" {
3535 #endif
3636
37 #include "bits.h"
3738 #include "neaacdec.h"
3839
3940 int8_t AudioSpecificConfig2(uint8_t *pBuffer,
914914 /* element_output_channels not set yet */
915915 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
916916 } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != output_channels) {
917 /* element inconsistency
918 * this only happens if PS is actually found but not in the first frame
917 /* element inconsistency */
918
919 /* this only happens if PS is actually found but not in the first frame
919920 * this means that there is only 1 bitstream element!
920921 */
921922
922 if (hDecoder->fr_channels == 1) {
923 /* reset the allocation */
924 hDecoder->element_alloced[hDecoder->fr_ch_ele] = 0;
925 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
926 } else {
927 return 21;
928 }
923 /* reset the allocation */
924 hDecoder->element_alloced[hDecoder->fr_ch_ele] = 0;
925
926 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
927
928 //return 21;
929929 }
930930
931931 if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0)
937937 hDecoder->element_alloced[hDecoder->fr_ch_ele] = 1;
938938 }
939939
940 /* sanity check, CVE-2018-20199, CVE-2018-20360 */
941 if(!hDecoder->time_out[sce->channel])
942 return 15;
940943
941944 /* dequantisation and scaling */
942945 retval = quant_to_spec(hDecoder, ics, spec_data, spec_coef, hDecoder->frameLength);
11161119
11171120 hDecoder->element_alloced[hDecoder->fr_ch_ele] = 2;
11181121 }
1122
1123 /* sanity check, CVE-2018-20199, CVE-2018-20360 */
1124 if(!hDecoder->time_out[cpe->channel])
1125 return 15;
11191126
11201127 /* dequantisation and scaling */
11211128 retval = quant_to_spec(hDecoder, ics1, spec_data1, spec_coef1, hDecoder->frameLength);
26432643 return (len*8)-(endpos-initpos);
26442644 //faad_getbits(ld, initpos-endpos); //go back to initpos, but is valid a getbits(-N) ?
26452645 }
2646 return -1U;
2647 }
2646 return 0xFFFFFFFF;
2647 }