Michael Niedermayer
9386f334af
avcodec/bitstream: Dont try to free buffers for static VLCs
...
Such buffers are not malloced thus freeing would be bad.
Note though this condition never could have happened so this
is more for correctness sake and not a true bugfix
Fixes CID1061047
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
f80ccf074a
avcodec/ff_init_vlc_sparse: use a local array for static vlcs avoiding malloc()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6af8326354
avcodec/ff_init_vlc_sparse: use a spinlock for thread sync
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a9903f7ec1
Revert "bitstream: make vlc init of static tables thread safe."
...
This reverts commit 4b6869d6e0
.
Conflicts:
libavcodec/bitstream.c
This code can cause assertion failures on artificial OOM situations
It will be replaced by a solution that doesnt have this issue in the
following commits.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Piotr Bandurski
aa74810fc6
bitstream: fix a crash in case of oom
...
fixes ticket #2766
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
f80b60ad59
bitstream: forward error values and drop few abort()
12 years ago
Luca Barbato
f776899a17
bitstream: K&R formatting cosmetics
12 years ago
Michael Niedermayer
1d7e6a6bde
avcodec/bitstream: print vlc length in error case.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
83330cf5fa
init_vlc_sparse: fix leak on error
...
Fixes CID1005312
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6998af4a40
avcodec/bitstream: check codes in ff_init_vlc_sparse()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
fb3e3808ae
avcodec/bitstream: Check bits in ff_init_vlc_sparse()
...
Fixes out of array reads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
511cf612ac
miscellaneous typo fixes
12 years ago
Michael Niedermayer
4b6869d6e0
bitstream: make vlc init of static tables thread safe.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
eed865540a
Revert "Add assert that the avcodec lock is held when initializing static VLC tables."
...
This reverts commit dd154198b1
.
12 years ago
Reimar Döffinger
dd154198b1
Add assert that the avcodec lock is held when initializing static VLC tables.
...
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
12 years ago
Diego Biurrun
d5c62122a7
Move av_reverse table to libavcodec
...
It is only used in that library.
12 years ago
Martin Storsjö
aefea4d0de
Rename ff_put_string to avpriv_put_string
...
This allows using it from libavformat as well. This will be used
by the RTP/JPEG depacketizer.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
bb1e0e80b0
libavcodec/bitstream: switch to av_assert
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
2e909b3c77
bitstream: build_table, check table_nb_bits.
...
Fixes null ptr deref.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Martin Storsjö
e96b4a53df
vlc/rl: Add ff_ prefix to the nonstatic symbols
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Alex Converse
7181c4edee
cosmetics: Remove extra newlines at EOF
13 years ago
Diego Biurrun
da9cea77e3
Fix a bunch of common typos.
13 years ago
Anton Khirnov
9f51c682ee
lavc: use avpriv_ prefix for ff_copy_bits and align_put_bits.
...
They are used in lavf.
13 years ago
Nicolas George
198ed6474d
bitstream: Replace av_realloc by av_realloc_f when relevant.
...
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Mans Rullgard
0d5c349ac4
put_bits: remove ALT_BITSTREAM_WRITER
...
The code for this variant does not compile.
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Michael Niedermayer
294e5475c2
ffv1: fix undefined behavior with insane widths.
...
The new tables is large enough to prevent this together with our image size checks.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
14 years ago
Alex Converse
19d824e473
bitstream: Properly promote av_reverse values before shifting.
14 years ago
Diego Biurrun
02a8d43adf
Replace some av_log/printf + #ifdef combinations by av_dlog.
14 years ago
Michael Niedermayer
676d380f2a
Fix undefined behavior in ffv1 with insane widths.
...
The new tables is large enough to prevent this together with our image size checks.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Mans Rullgard
2912e87a6c
Replace FFmpeg with Libav in licence headers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Loren Merritt
f39ab2071f
change a variable-length array to a malloc.
...
Originally committed as revision 23103 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Diego Biurrun
ba87f0801d
Remove explicit filename from Doxygen @file commands.
...
Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.
Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Loren Merritt
b23cf13c67
indent
...
Originally committed as revision 22716 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Loren Merritt
3224079956
optimize init_vlc().
...
Reduce worst case time from O(N^2) to O(N*log(N)).
Speedup average case by a factor of 10 in ffv2 (total decoding speed +4-25%),
factor of 1.3 in ffvhuff (total +0.5%),
factor of 1.8 in indeo5 (total +1%),
factor of 1.1 in mjpeg (total +0.1%).
Originally committed as revision 22715 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Måns Rullgård
769c497565
indent
...
Originally committed as revision 21940 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Måns Rullgård
4c4e746566
Avoid negative shifts in build_table()
...
A shift by a negative amount has undefined behaviour. Even though
the result of this shift is never used, the shift itself could
cause an exception of some kind.
Originally committed as revision 21939 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
587edd6af8
Use more consistent / meaningful parameter names for the
...
ff_copy_bits() function.
Originally committed as revision 20663 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Reimar Döffinger
ef530829f8
Remove ff_realloc_static, it is no longer used and since it was declared
...
static there is no reason to wait for a major version bump, removing
it does not change ABI in any way, not even the non-public one.
Originally committed as revision 20023 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Reimar Döffinger
1e224c5480
Reindent.
...
Originally committed as revision 20022 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Reimar Döffinger
e518a49f34
Remove a piece of code left-over from the removed alloc'd static vlc table code.
...
Originally committed as revision 20021 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Reimar Döffinger
595324e143
Completely remove INIT_VLC_USE_STATIC, it is deprecated since ages and
...
finally no longer used anywhere.
Originally committed as revision 20013 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Måns Rullgård
ec62d942ea
Fix potentially unaligned accesses in ff_copy_bits()
...
A pointer should never be assigned a value which may have less than the
required alignment of the target type. Compilers may assume pointer
values have the required alignment, and emit normal load/store instructions.
Unaligned pointers should use a character type or compiler-specific
type modifiers.
Originally committed as revision 19318 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Stefano Sabatini
fb53b4a035
Rename pbBufPtr() to put_bits_ptr().
...
The new name is more readable and consistent with the FFmpeg naming
style.
Originally committed as revision 18497 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Stefano Sabatini
9106a698e7
Rename bitstream.h to get_bits.h.
...
Originally committed as revision 18494 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Stefano Sabatini
b275500706
Split bitstream.h, put the bitstream writer stuff in the new file
...
put_bits.h.
Originally committed as revision 18461 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Stefano Sabatini
54b02ccda2
Rename the 'put_zero' parameter of ff_put_string() to
...
'terminate_string'.
Originally committed as revision 18442 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
2bbd85719c
Remove deprecated functions and structures on next version bump.
...
Originally committed as revision 18110 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Måns Rullgård
f49568a467
Fix unaligned access in ff_copy_bits()
...
Originally committed as revision 17921 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
bad5537e2c
Use full internal pathname in doxygen @file directives.
...
Otherwise doxygen complains about ambiguous filenames when files exist
under the same name in different subdirectories.
Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
406792e7b0
cosmetics: Remove pointless period after copyright statement non-sentences.
...
Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago