Compare commits

...

96 Commits

Author SHA1 Message Date
Michael Niedermayer
39fe8033bb Update for 0.11.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 22:53:09 +02:00
Michael Niedermayer
964f8419dd probetest: allow specifying parameters on the command line
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6cfaccabc4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 01:06:58 +02:00
Michael Niedermayer
5c2ffa2ce7 mpegvideo: fix out of heap array accesses
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 317ca0d3f7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Michael Niedermayer
6be8e44c00 search_for_quantizers_faac: fix curband
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 33775c3507)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Reimar Döffinger
565581b0a4 ffmpeg: avoid a confusing and easy to break if().
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 93147daf59)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Michael Niedermayer
dc85ca0945 ffmpeg: use isatty() before messing with the terminal state
This fixes terminal messup in case of crashes (like in make fate)

Reviewed-by: François Revol <revol@free.fr>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c8a11014b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Michael Niedermayer
a53ca16ae9 swr-test: support "--help"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 787c395a30)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Michael Niedermayer
92e5e62156 buildsys: fix rules for swresample-test
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 63b1c08073)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Carl Eugen Hoyos
e1c9434424 Make H264 reorder buffer size message less verbose.
(cherry picked from commit a3bc7f916d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Carl Eugen Hoyos
af3f7c88f2 Add missing CRLFs to avisynth error messages.
(cherry picked from commit 1faf0d6a7a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Carl Eugen Hoyos
b4294e2319 Fix MP2 muxer Makefile dependencies.
Found, analysed and tested by trac user Jamal.

Fixes ticket #1411
(cherry picked from commit 757d5b9bfd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Kostya Shishkov
7d97936495 mpc8: fix maximum bands handling
In Musepack SV8 codec property tell the maximum nonzero band, but every
frame codes maximum band as a limit (i.e. strictly less than given value).
Synthesis also expects maximum nonzero band, so there's a need to convert
frame maximum band limit value.
(cherry picked from commit b56825c40e)

Conflicts:

	libavcodec/mpc8.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Alex Converse
f9fc08de65 aacdec: Turn PS off when switching to stereo and turn it to implicit when switching to mono.
(cherry picked from commit 79c8e29a7e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Carl Eugen Hoyos
31d3b3b5d5 Fix compilation condition for some ProRes dsp encoder functions.
Found, analysed and tested by trac user Jamal.

Fixes part of Ticket #1404.
(cherry picked from commit 568a592418)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Carl Eugen Hoyos
706809adb2 Fix compilation condition for some ProRes dsp decoder functions.
Found, analysed and tested by trac user Jamal.

Fixes part of Ticket #1404.
(cherry picked from commit 84986b4e61)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Carl Eugen Hoyos
4e66ca5f37 Fix ProRes decoder Makefile dependencies.
Found, analysed and tested by trac user Jamal.

Fixes part of Ticket #1404.
(cherry picked from commit a4b885d55e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Carl Eugen Hoyos
530ce76a05 Fix G.723.1 encoder Makefile dependencies.
(cherry picked from commit c02ef07881)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Michael Niedermayer
0e74b21427 ffv1dec: print more information for -debug 1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 38c9ebd2a9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
381a914024 ffv1: fix log level of FF_DEBUG_PICT_INFO
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 730d079bf7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
d0d9182d3e mpc8: fix channel checks
fix heap array overflow

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 44c10168cf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
320704f739 av_get_audio_frame_duration: fix FPE
Fixes ticket1392

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a5ad3c2382)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
be1d65031f mace: check channel count, fixes FPE
Fixes ticket1391

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6df1cfa7e4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
bbc4d287c9 h263: disable loop filter with lowres
Fixes ticket1212

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc229d4e83)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
3bb942e6f0 mpc7: fix handling of last frame
Fixes heap buffer overflow
Fixes ticket1393

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e95233789c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
e863d3306f oggdec: fix regression that caused reading the whole file during open
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e0eaf10049)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
433ec3afa3 png_parser: dont falsely mark frames as keyframes
Fixes Ticket1381

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 82570d2f09)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
d0cb4dc471 lavf: use input keyframe flag when muxer does not provide keyframe flags.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5665674b55)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
95b1cbc4cb bink: fix out of reference frame read
Fixes Ticket1374

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b3675f890a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
177fc2438a h264: log debug output for slightly truncated streams
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fb4e434cfb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
46b99bb70c h264: try to better handle h264 streams that are slightly truncated
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cd0f9f00a2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
03275ed219 bmv: fix apparent sign error in the frame_off check
Fixes part of Ticket1373

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit debbcfae60)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
ae5f69a98f bmv: fix integer overflows in vlc decoder.
Fixes part of Ticket1373

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Based-on-patch-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 679c578cb8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
dc72a59fe5 ffv1: fix integer overflow in quant table initialization
Fixes part of Ticket1372

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9ebe6e3910)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
70af4f209f ffv1: fix crash caused by version becoming inconsistent
Fixes part of Ticket1372

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 97c281d5b7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
0964e189da fraps: fix version 0/1 input data size check.
Fixes array overread.
Fixes Ticket1371

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0bae6661cd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
7883efbbb2 wmv1: check that the input buffer is large enough
Fixes null ptr deref
Fixes Ticket1367

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f23a2418fb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
af67af5938 rv20: fix lowres out of array read
Fixes Ticket1239

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0766b6e3ec)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
d3c564b784 yopdec: check frame oddness to be within supported limits
Fixes Ticket1365

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit febc013dc5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
bb5314daba yopdec: check that palette fits in the packet
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b6fdf8dea7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
33a3f1fe9d 8svx: fix crash
Fixes Ticket1377

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03ce421c13)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Piotr Bandurski
ac3fc94eb0 sgienc: add a limit for maximum supported resolution
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 59352cc219)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
d838c40823 qdm2: fix incorrect error spam
Fixes Ticket1375

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8a0efa9cc0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
eea82203ba libmp3lame: add missing layout terminator
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e47e23698b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
617d91b76a h264: Fail on DPC its not fully implemented
Fixes part of Ticket1369

Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7cb8663362)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
f1150e0c7d dv-demux: dont mess with codec values
Fixes part of Ticket1369

Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c276ac0f8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Clément Bœsch
f46b57657b jacosub_probe: slightly increase the score to limit misdetection.
(cherry picked from commit 303619d3ca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Clément Bœsch
662ab44c2d jacosub_probe: speedup by making only one call to sscanf
(cherry picked from commit 908293d1bc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
cc0a684497 h264: move q0 scan tables into context
This fixes out of global array reads.
The alternative solutions of checking the index or modifying the VLC tables
to prevent the index going outside are each about 1-2 cpu cyclces slower
per coded 4x4 block.
The alternative of padding the global tables directly is more ugly and
moving them to the context should benefit cache locality.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b7d1488393)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
7f0f6602cb oggparsevorbis: fix null ptr dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 18b46a494e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
d5d5f96068 mpeg4videodec: Check that cplx_estimation_* fits in the available space
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b02cc2ddc6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Piotr Bandurski
91ac6d9902 gifenc: support resolutions up to 65535x65535
Maybe someone can add a check in the second gif encoder (rgb24), because I'm not sure where it should be added.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e03ddbcd91)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
0a311df6d9 ipmovie_probe: speedup by avoiding memcmp() call
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc4d80c99f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
48094cb23a ac3_probe: speedup by checking for header earlier
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ebfe0c6eb8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Paul B Mahol
d3d6849d17 binkaudio: check number of channels
Fixes #1380.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 824a6975ee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
ddb92c6df1 indeo5: check quant_mat
prevents out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8aaa00c301)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
55a97399bc ffv1: fix reading global header with CRC
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 21fdf1ccf0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
eecbd9a78f avidec: fix odd extradata size case.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 57778f61d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
a441a96eb2 libavformat: ff_get_bmp_header: return esize too
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 76853a3e0c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
dff4dbdf60 h264_cavlc: check prefix before using it.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 39f0a45a1a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
622e926e9c h264: increase scantable sizes to avoid overread
We could also check the index but this would slow speed critical code
down.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32e60b6bfe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Michael Niedermayer
8ad71e276c truemotion1: Check index, fix out of array read
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fd4c1c0b70)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Paul B Mahol
cdcd99eecc exr: make message about missing feature more useful
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit f5af8d5e76)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Paul B Mahol
9dc14fd3f0 iff: check if there is extradata
Fixes #1368.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 8f61526978)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Paul B Mahol
ba2d20b449 exr: alpha support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit d66b0cd5c5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:24 +02:00
Lou Logan
b395bac383 lavc: clarify experimental codec message
Should be easier for new users to get a working output.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 73f3f6baff)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:23 +02:00
Michael Niedermayer
3768afd5a5 ape: Fix null ptr dereference with files missing a seekatable.
Such files are currently not supported as the table is used at several points

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e7cb161515)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:23 +02:00
Michael Niedermayer
e0f0486c7f movdec: Check count of stts/ctts elements instead of just the pointer.
Fixes overreading the array

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5880d78873)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:23 +02:00
Michael Niedermayer
56e987d2cd 4xm: fix division by zero caused by bps<8
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1b8741a684)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:23 +02:00
Michael Niedermayer
c64bfd7c3d lavfi: use getter/setter functions for AVFrame.pkt_pos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 59a78290b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:23 +02:00
Robert Nagy
0e2b69b4e6 lavfi: Fill linesize, sample_rate and channel_layout fields in avfilter_fill_frame_from_audio_buffer_ref.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2eae4bae7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:23 +02:00
Michael Niedermayer
63040dcddd configure: fix the wording for gpl incompatible licenses warnings
calling the 4 clause BSD license non free is quite a stretch ;)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d5a17d7f4d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:23 +02:00
Michael Niedermayer
1e78d75d6a configure: openssl is compatible with the LGPL.
looking at the license i cannot see why they would be incompatible and
researching this matter a bit also turned up no reasons.

If i missed something, please dont hesitate to flame me and or revert

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f997ac1c8b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:23 +02:00
Michael Niedermayer
91fdba3d79 configure: disable avresample by default
avresample is redundant and unneeded

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f2bc2e8954)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 20:00:18 +02:00
Michael Niedermayer
68efb539e3 configure: add asyncts->avresample dependancy
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0e39889ad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 20:00:14 +02:00
Carl Eugen Hoyos
ee50ec19c7 Fix r10k codec for widths that are not multiples of 64.
Fixes ticket #1358
(cherry picked from commit 5cd947d81b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 19:33:44 +02:00
Carl Eugen Hoyos
3a68e989ec Mark avui encoder experimental.
Some decoders require the AVID atom that we currently
do not write when encoding avui.
(cherry picked from commit 77cea13f05)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 19:33:43 +02:00
Michael Niedermayer
61a72fd9c8 jvdec: check videosize
Fixes null ptr dereference
fixes Ticket1364

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b4904e804d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 17:26:21 +02:00
Michael Niedermayer
c254214ea3 motionpixels: check extradata size
Fixes null ptr derefernce
Fixes Ticket1363

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 50122084a6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 17:26:20 +02:00
Michael Niedermayer
59417897be iff_ilbm: fix null ptr deref
Fixes Ticket1362

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 849d4b0413)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 17:26:19 +02:00
Michael Niedermayer
03f82b5668 yop: check for missing extradata
Fixes null ptr deref
Fixes Ticket1361

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 77a4c8b959)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 17:26:18 +02:00
Michael Niedermayer
7f8059bdfe xan: fix out of array read
Fixes ticket1360

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 01900fcc45)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 17:26:17 +02:00
Michael Niedermayer
0f9098cb18 cdgraphics: Fix out of array write
Fixes Ticket1359

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1e5c7376c4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 17:26:16 +02:00
Carl Eugen Hoyos
c4e3dd06e8 Test extradata size before reading from extradata when decoding avui.
(cherry picked from commit 83de4f5fc9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 17:26:15 +02:00
Michael Niedermayer
88a145738b avienc: create xsub in avi files that are closer to whats in the wild
Fixes ticket1332

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 875851294f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-27 23:25:29 +02:00
Clément Bœsch
1ed0a61ea8 Changelog: fix wrong/inaccurate entries.
(cherry picked from commit 80bf2b6e84)

Conflicts:

	Changelog
2012-05-27 16:12:42 +02:00
Clément Bœsch
9f2905d299 lavfi/deshake: add libavcodec dependency (dsputil).
(cherry picked from commit 5c3f79198c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-27 16:12:02 +02:00
Marton Balint
f6c3fe94da ffplay: flush codec buffers before freeing filters
We do this to ensure that input_get_buffer is not called from a
frame_worker_thread of a multithreaded decoder when we already freed the
filters.

Fixes occasional segfaults on video stream change.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit c2e8691c07)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-27 16:12:02 +02:00
Marton Balint
727749d30f ffplay: fix stream cycling if audio decoding fails
Fixes ticket 1161.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 8c9971c35e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-27 16:12:02 +02:00
Marton Balint
c7c82acf96 ffplay: force exit when filter configuration fails
Switching to visualization instead of exiting ffplay is a bit more tricky, so
just exit for now.

Fixes ticket 38.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 7315e40a24)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-27 16:12:02 +02:00
Marton Balint
f8f5db3b70 ffplay: dont destroy packet queues on stream change
This fixes occasional segfaults caused by lock request of the packet queue from
the reader thread.

Also don't allow to put frames into the queue when it's aborted, and don't try
to fill the queue with frames when it is aborted.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit a687acbbf0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-27 16:12:02 +02:00
Alexis Ballier
51157dab37 Fix tests without fate samples.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0bf90ceb84)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-26 20:51:45 +02:00
Michael Niedermayer
982caeac3e af_aresample: fix pts, they where off by a packet in the -async >0 case.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be97675e6c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-26 17:56:33 +02:00
Michael Niedermayer
d108d0804a Changelog, spell out the CVEs that where fixed.
there are some holes in the list as some things have been fixed
in previous releases already.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit aeb2dea802)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-26 17:56:32 +02:00
Michael Niedermayer
072e7fad87 swr: fix swr_drop_output()
Fixes part of Ticket1341

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 72261fa867)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-26 02:59:22 +02:00
Michael Niedermayer
484302d183 af_aresample: fix request_frame()
Fixes part of Ticket1341

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 411689b5e1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-26 02:59:22 +02:00
Michael Niedermayer
734cfa8e8b Update for 0.11
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-25 19:48:47 +02:00
76 changed files with 409 additions and 189 deletions

View File

@@ -4,7 +4,12 @@ releases are sorted from youngest to oldest.
version next:
version 0.11:
- Fixes CVE-2012-2771 ... 2805
Fixes:CVE-2012-2772, CVE-2012-2774, CVE-2012-2775, CVE-2012-2776, CVE-2012-2777,
CVE-2012-2779, CVE-2012-2782, CVE-2012-2783, CVE-2012-2784, CVE-2012-2785,
CVE-2012-2786, CVE-2012-2787, CVE-2012-2788, CVE-2012-2789, CVE-2012-2790,
CVE-2012-2791, CVE-2012-2792, CVE-2012-2793, CVE-2012-2794, CVE-2012-2795,
CVE-2012-2796, CVE-2012-2797, CVE-2012-2798, CVE-2012-2799, CVE-2012-2800,
CVE-2012-2801, CVE-2012-2802, CVE-2012-2803, CVE-2012-2804,
- v408 Quicktime and Microsoft AYUV Uncompressed 4:4:4:4 encoder and decoder
- setfield filter
- CDXL demuxer and decoder
@@ -33,7 +38,7 @@ version 0.11:
- MicroDVD decoder
- Avid Meridien (AVUI) encoder and decoder
- accept + prefix to -pix_fmt option to disable automatic conversions.
- audio filters support in libavfilter and avconv
- complete audio filtering in libavfilter and ffmpeg
- add fps filter
- audio split filter
- vorbis parser

View File

@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 0.11.1
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55

View File

@@ -1 +1 @@
0.10.2.git
0.11.1

1
VERSION Normal file
View File

@@ -0,0 +1 @@
0.11.1

11
configure vendored
View File

@@ -112,7 +112,7 @@ Component options:
--disable-swscale disable libswscale build
--disable-postproc disable libpostproc build
--disable-avfilter disable video filter support [no]
--disable-avresample disable libavresample build [no]
--enable-avresample enable libavresample build [no]
--disable-pthreads disable pthreads [auto]
--disable-w32threads disable Win32 threads [auto]
--disable-os2threads disable OS/2 threads [auto]
@@ -1676,11 +1676,13 @@ aconvert_filter_deps="swresample"
amovie_filter_deps="avcodec avformat"
aresample_filter_deps="swresample"
ass_filter_deps="libass"
asyncts_filter_deps="avresample"
blackframe_filter_deps="gpl"
boxblur_filter_deps="gpl"
colormatrix_filter_deps="gpl"
cropdetect_filter_deps="gpl"
delogo_filter_deps="gpl"
deshake_filter_deps="avcodec"
drawtext_filter_deps="libfreetype"
frei0r_filter_deps="frei0r dlopen"
frei0r_filter_extralibs='$ldl'
@@ -1878,7 +1880,6 @@ enable avcodec
enable avdevice
enable avfilter
enable avformat
enable avresample
enable avutil
enable postproc
enable stripping
@@ -2852,6 +2853,10 @@ die_license_disabled() {
enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
}
die_license_disabled_gpl() {
enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
}
die_license_disabled gpl libcdio
die_license_disabled gpl libutvideo
die_license_disabled gpl libx264
@@ -2861,7 +2866,7 @@ die_license_disabled gpl x11grab
die_license_disabled nonfree libaacplus
die_license_disabled nonfree libfaac
die_license_disabled nonfree openssl
enabled gpl && die_license_disabled_gpl nonfree openssl
die_license_disabled version3 libopencore_amrnb
die_license_disabled version3 libopencore_amrwb

View File

@@ -1,7 +1,7 @@
Release Notes
=============
* 0.10 "Freedom" January, 2012
* 0.11 "Happiness" May, 2012
General notes

View File

@@ -1456,8 +1456,11 @@ static void term_init(void)
#if HAVE_TERMIOS_H
if(!run_as_daemon){
struct termios tty;
if (tcgetattr (0, &tty) == 0) {
int istty = 1;
#if HAVE_ISATTY
istty = isatty(0) && isatty(2);
#endif
if (istty && tcgetattr (0, &tty) == 0) {
oldtty = tty;
restore_tty = 1;
atexit(term_exit);

117
ffplay.c
View File

@@ -232,6 +232,7 @@ typedef struct VideoState {
#endif
int refresh;
int last_video_stream, last_audio_stream, last_subtitle_stream;
} VideoState;
typedef struct AllocEventProps {
@@ -303,13 +304,12 @@ void av_noreturn exit_program(int ret)
exit(ret);
}
static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
static int packet_queue_put_private(PacketQueue *q, AVPacket *pkt)
{
AVPacketList *pkt1;
/* duplicate the packet */
if (pkt != &flush_pkt && av_dup_packet(pkt) < 0)
return -1;
if (q->abort_request)
return -1;
pkt1 = av_malloc(sizeof(AVPacketList));
if (!pkt1)
@@ -317,11 +317,7 @@ static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
pkt1->pkt = *pkt;
pkt1->next = NULL;
SDL_LockMutex(q->mutex);
if (!q->last_pkt)
q->first_pkt = pkt1;
else
q->last_pkt->next = pkt1;
@@ -330,18 +326,34 @@ static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
q->size += pkt1->pkt.size + sizeof(*pkt1);
/* XXX: should duplicate packet data in DV case */
SDL_CondSignal(q->cond);
SDL_UnlockMutex(q->mutex);
return 0;
}
static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
{
int ret;
/* duplicate the packet */
if (pkt != &flush_pkt && av_dup_packet(pkt) < 0)
return -1;
SDL_LockMutex(q->mutex);
ret = packet_queue_put_private(q, pkt);
SDL_UnlockMutex(q->mutex);
if (pkt != &flush_pkt && ret < 0)
av_free_packet(pkt);
return ret;
}
/* packet queue handling */
static void packet_queue_init(PacketQueue *q)
{
memset(q, 0, sizeof(PacketQueue));
q->mutex = SDL_CreateMutex();
q->cond = SDL_CreateCond();
packet_queue_put(q, &flush_pkt);
q->abort_request = 1;
}
static void packet_queue_flush(PacketQueue *q)
@@ -361,7 +373,7 @@ static void packet_queue_flush(PacketQueue *q)
SDL_UnlockMutex(q->mutex);
}
static void packet_queue_end(PacketQueue *q)
static void packet_queue_destroy(PacketQueue *q)
{
packet_queue_flush(q);
SDL_DestroyMutex(q->mutex);
@@ -379,6 +391,14 @@ static void packet_queue_abort(PacketQueue *q)
SDL_UnlockMutex(q->mutex);
}
static void packet_queue_start(PacketQueue *q)
{
SDL_LockMutex(q->mutex);
q->abort_request = 0;
packet_queue_put_private(q, &flush_pkt);
SDL_UnlockMutex(q->mutex);
}
/* return < 0 if aborted, 0 if no packet and > 0 if packet. */
static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block)
{
@@ -877,6 +897,9 @@ static void stream_close(VideoState *is)
is->abort_request = 1;
SDL_WaitThread(is->read_tid, NULL);
SDL_WaitThread(is->refresh_tid, NULL);
packet_queue_destroy(&is->videoq);
packet_queue_destroy(&is->audioq);
packet_queue_destroy(&is->subtitleq);
/* free all pictures */
for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
@@ -1816,8 +1839,13 @@ static int video_thread(void *arg)
int last_w = is->video_st->codec->width;
int last_h = is->video_st->codec->height;
if ((ret = configure_video_filters(graph, is, vfilters)) < 0)
if ((ret = configure_video_filters(graph, is, vfilters)) < 0) {
SDL_Event event;
event.type = FF_QUIT_EVENT;
event.user.data1 = is;
SDL_PushEvent(&event);
goto the_end;
}
filt_out = is->out_video_filter;
#endif
@@ -1893,6 +1921,7 @@ static int video_thread(void *arg)
stream_toggle_pause(is);
}
the_end:
avcodec_flush_buffers(is->video_st->codec);
#if CONFIG_AVFILTER
av_freep(&vfilters);
avfilter_graph_free(&graph);
@@ -2240,9 +2269,9 @@ static int stream_component_open(VideoState *is, int stream_index)
opts = filter_codec_opts(codec_opts, codec, ic, ic->streams[stream_index]);
switch(avctx->codec_type){
case AVMEDIA_TYPE_AUDIO : if(audio_codec_name ) codec= avcodec_find_decoder_by_name( audio_codec_name); break;
case AVMEDIA_TYPE_SUBTITLE: if(subtitle_codec_name) codec= avcodec_find_decoder_by_name(subtitle_codec_name); break;
case AVMEDIA_TYPE_VIDEO : if(video_codec_name ) codec= avcodec_find_decoder_by_name( video_codec_name); break;
case AVMEDIA_TYPE_AUDIO : is->last_audio_stream = stream_index; if(audio_codec_name ) codec= avcodec_find_decoder_by_name( audio_codec_name); break;
case AVMEDIA_TYPE_SUBTITLE: is->last_subtitle_stream = stream_index; if(subtitle_codec_name) codec= avcodec_find_decoder_by_name(subtitle_codec_name); break;
case AVMEDIA_TYPE_VIDEO : is->last_video_stream = stream_index; if(video_codec_name ) codec= avcodec_find_decoder_by_name( video_codec_name); break;
}
if (!codec)
return -1;
@@ -2343,20 +2372,20 @@ static int stream_component_open(VideoState *is, int stream_index)
is->audio_diff_threshold = 2.0 * SDL_AUDIO_BUFFER_SIZE / wanted_spec.freq;
memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
packet_queue_init(&is->audioq);
packet_queue_start(&is->audioq);
SDL_PauseAudio(0);
break;
case AVMEDIA_TYPE_VIDEO:
is->video_stream = stream_index;
is->video_st = ic->streams[stream_index];
packet_queue_init(&is->videoq);
packet_queue_start(&is->videoq);
is->video_tid = SDL_CreateThread(video_thread, is);
break;
case AVMEDIA_TYPE_SUBTITLE:
is->subtitle_stream = stream_index;
is->subtitle_st = ic->streams[stream_index];
packet_queue_init(&is->subtitleq);
packet_queue_start(&is->subtitleq);
is->subtitle_tid = SDL_CreateThread(subtitle_thread, is);
break;
@@ -2381,7 +2410,7 @@ static void stream_component_close(VideoState *is, int stream_index)
SDL_CloseAudio();
packet_queue_end(&is->audioq);
packet_queue_flush(&is->audioq);
av_free_packet(&is->audio_pkt);
if (is->swr_ctx)
swr_free(&is->swr_ctx);
@@ -2407,7 +2436,7 @@ static void stream_component_close(VideoState *is, int stream_index)
SDL_WaitThread(is->video_tid, NULL);
packet_queue_end(&is->videoq);
packet_queue_flush(&is->videoq);
break;
case AVMEDIA_TYPE_SUBTITLE:
packet_queue_abort(&is->subtitleq);
@@ -2422,7 +2451,7 @@ static void stream_component_close(VideoState *is, int stream_index)
SDL_WaitThread(is->subtitle_tid, NULL);
packet_queue_end(&is->subtitleq);
packet_queue_flush(&is->subtitleq);
break;
default:
break;
@@ -2469,9 +2498,9 @@ static int read_thread(void *arg)
int orig_nb_streams;
memset(st_index, -1, sizeof(st_index));
is->video_stream = -1;
is->audio_stream = -1;
is->subtitle_stream = -1;
is->last_video_stream = is->video_stream = -1;
is->last_audio_stream = is->audio_stream = -1;
is->last_subtitle_stream = is->subtitle_stream = -1;
ic = avformat_alloc_context();
ic->interrupt_callback.callback = decode_interrupt_cb;
@@ -2625,9 +2654,9 @@ static int read_thread(void *arg)
/* if the queue are full, no need to read more */
if ( is->audioq.size + is->videoq.size + is->subtitleq.size > MAX_QUEUE_SIZE
|| ( (is->audioq .nb_packets > MIN_FRAMES || is->audio_stream < 0)
&& (is->videoq .nb_packets > MIN_FRAMES || is->video_stream < 0)
&& (is->subtitleq.nb_packets > MIN_FRAMES || is->subtitle_stream < 0))) {
|| ( (is->audioq .nb_packets > MIN_FRAMES || is->audio_stream < 0 || is->audioq.abort_request)
&& (is->videoq .nb_packets > MIN_FRAMES || is->video_stream < 0 || is->videoq.abort_request)
&& (is->subtitleq.nb_packets > MIN_FRAMES || is->subtitle_stream < 0 || is->subtitleq.abort_request))) {
/* wait 10 ms */
SDL_Delay(10);
continue;
@@ -2732,6 +2761,10 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
is->subpq_mutex = SDL_CreateMutex();
is->subpq_cond = SDL_CreateCond();
packet_queue_init(&is->videoq);
packet_queue_init(&is->audioq);
packet_queue_init(&is->subtitleq);
is->av_sync_type = av_sync_type;
is->read_tid = SDL_CreateThread(read_thread, is);
if (!is->read_tid) {
@@ -2745,16 +2778,19 @@ static void stream_cycle_channel(VideoState *is, int codec_type)
{
AVFormatContext *ic = is->ic;
int start_index, stream_index;
int old_index;
AVStream *st;
if (codec_type == AVMEDIA_TYPE_VIDEO)
start_index = is->video_stream;
else if (codec_type == AVMEDIA_TYPE_AUDIO)
start_index = is->audio_stream;
else
start_index = is->subtitle_stream;
if (start_index < (codec_type == AVMEDIA_TYPE_SUBTITLE ? -1 : 0))
return;
if (codec_type == AVMEDIA_TYPE_VIDEO) {
start_index = is->last_video_stream;
old_index = is->video_stream;
} else if (codec_type == AVMEDIA_TYPE_AUDIO) {
start_index = is->last_audio_stream;
old_index = is->audio_stream;
} else {
start_index = is->last_subtitle_stream;
old_index = is->subtitle_stream;
}
stream_index = start_index;
for (;;) {
if (++stream_index >= is->ic->nb_streams)
@@ -2762,9 +2798,12 @@ static void stream_cycle_channel(VideoState *is, int codec_type)
if (codec_type == AVMEDIA_TYPE_SUBTITLE)
{
stream_index = -1;
is->last_subtitle_stream = -1;
goto the_end;
} else
stream_index = 0;
}
if (start_index == -1)
return;
stream_index = 0;
}
if (stream_index == start_index)
return;
@@ -2786,7 +2825,7 @@ static void stream_cycle_channel(VideoState *is, int codec_type)
}
}
the_end:
stream_component_close(is, start_index);
stream_component_close(is, old_index);
stream_component_open(is, stream_index);
}

View File

@@ -47,7 +47,7 @@ typedef struct EightSvxContext {
/* buffer used to store the whole audio decoded/interleaved chunk,
* which is sent with the first packet */
uint8_t *samples;
size_t samples_size;
int64_t samples_size;
int samples_idx;
} EightSvxContext;

View File

@@ -188,7 +188,7 @@ OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
OBJS-$(CONFIG_G723_1_DECODER) += g723_1.o acelp_vectors.o \
celp_filters.o celp_math.o
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1.o
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1.o acelp_vectors.o celp_math.o
OBJS-$(CONFIG_G729_DECODER) += g729dec.o lsp.o celp_math.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o
OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
@@ -347,7 +347,7 @@ OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o pngdsp.o
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o pnm.o
OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o
OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o proresdsp.o
OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o proresdata.o
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o
OBJS-$(CONFIG_PRORES_ANATOLIY_ENCODER) += proresenc_anatoliy.o
@@ -626,6 +626,7 @@ OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o
OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
flacdec.o flacdata.o flac.o \
mpegaudiodata.o vorbis_data.o
OBJS-$(CONFIG_MP2_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o ac3tab.o timecode.o
OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o

View File

@@ -878,7 +878,7 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
} else {
for (w = 0; w < 8; w++) {
const float *coeffs = sce->coeffs + w*128;
start = 0;
curband = start = 0;
for (i = 0; i < 128; i++) {
if (i - start >= sce->ics.swb_sizes[curband]) {
start += sce->ics.swb_sizes[curband];

View File

@@ -487,6 +487,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
return NULL;
ac->oc[1].m4ac.chan_config = 2;
ac->oc[1].m4ac.ps = 0;
}
// And vice-versa
if (!ac->tags_mapped && type == TYPE_SCE && ac->oc[1].m4ac.chan_config == 2) {
@@ -504,6 +505,8 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
return NULL;
ac->oc[1].m4ac.chan_config = 1;
if (ac->oc[1].m4ac.sbr)
ac->oc[1].m4ac.ps = -1;
}
// For indexed channel configurations map the channels solely based on position.
switch (ac->oc[1].m4ac.chan_config) {

View File

@@ -48,8 +48,8 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data,
if (pic->data[0])
avctx->release_buffer(avctx, pic);
if (!memcmp(&avctx->extradata[4], "APRGAPRG0001", 12) &&
avctx->extradata_size >= 24)
if (avctx->extradata_size >= 24 &&
!memcmp(&avctx->extradata[4], "APRGAPRG0001", 12))
interlaced = avctx->extradata[19] != 1;
if (avctx->height == 486) {
skip = 10;

View File

@@ -107,6 +107,7 @@ AVCodec ff_avui_encoder = {
.init = avui_encode_init,
.encode2 = avui_encode_frame,
.close = avui_encode_close,
.capabilities = CODEC_CAP_EXPERIMENTAL,
.pix_fmts = (const enum PixelFormat[]){ PIX_FMT_UYVY422, PIX_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"),
};

View File

@@ -1128,6 +1128,11 @@ static int bink_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx,
xoff = get_value(c, BINK_SRC_X_OFF);
yoff = get_value(c, BINK_SRC_Y_OFF);
ref = prev + xoff + yoff * stride;
if (ref < ref_start || ref > ref_end) {
av_log(c->avctx, AV_LOG_ERROR, "Copy out of bounds @%d, %d\n",
bx*8 + xoff, by*8 + yoff);
return -1;
}
c->dsp.put_pixels_tab[1][0](dst, ref, stride, 8);
memset(dctblock, 0, sizeof(*dctblock) * 64);
dctblock[0] = get_value(c, BINK_SRC_INTER_DC);

View File

@@ -91,9 +91,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
frame_len_bits = 11;
}
if (avctx->channels > MAX_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "too many channels: %d\n", avctx->channels);
return -1;
if (avctx->channels < 1 || avctx->channels > MAX_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n", avctx->channels);
return AVERROR_INVALIDDATA;
}
s->version_b = avctx->extradata && avctx->extradata[3] == 'b';

View File

@@ -21,6 +21,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "libavutil/avassert.h"
enum BMVFlags{
BMV_NOP = 0,
@@ -52,7 +53,7 @@ typedef struct BMVDecContext {
static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame, int frame_off)
{
int val, saved_val = 0;
unsigned val, saved_val = 0;
int tmplen = src_len;
const uint8_t *src, *source_end = source + src_len;
uint8_t *frame_end = frame + SCREEN_WIDE * SCREEN_HIGH;
@@ -98,6 +99,8 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
}
if (!(val & 0xC)) {
for (;;) {
if(shift>22)
return -1;
if (!read_two_nibbles) {
if (src < source || src >= source_end)
return -1;
@@ -131,6 +134,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
}
advance_mode = val & 1;
len = (val >> 1) - 1;
av_assert0(len>0);
mode += 1 + advance_mode;
if (mode >= 4)
mode -= 3;
@@ -139,7 +143,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
switch (mode) {
case 1:
if (forward) {
if (dst - frame + SCREEN_WIDE < frame_off ||
if (dst - frame + SCREEN_WIDE < -frame_off ||
frame_end - dst < frame_off + len)
return -1;
for (i = 0; i < len; i++)
@@ -147,7 +151,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
dst += len;
} else {
dst -= len;
if (dst - frame + SCREEN_WIDE < frame_off ||
if (dst - frame + SCREEN_WIDE < -frame_off ||
frame_end - dst < frame_off + len)
return -1;
for (i = len - 1; i >= 0; i--)

View File

@@ -280,6 +280,10 @@ static int cdg_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "buffer too small for decoder\n");
return AVERROR(EINVAL);
}
if (buf_size > CDG_HEADER_SIZE + CDG_DATA_SIZE) {
av_log(avctx, AV_LOG_ERROR, "buffer too big for decoder\n");
return AVERROR(EINVAL);
}
ret = avctx->reget_buffer(avctx, &cc->frame);
if (ret) {

View File

@@ -47,7 +47,7 @@ typedef struct EXRContext {
AVFrame picture;
int compr;
int bits_per_color_id;
int8_t channel_offsets[3]; // 0 = red, 1 = green and 2 = blue
int8_t channel_offsets[4]; // 0 = red, 1 = green, 2 = blue and 3 = alpha
} EXRContext;
/**
@@ -170,6 +170,7 @@ static int decode_frame(AVCodecContext *avctx,
s->channel_offsets[0] = -1;
s->channel_offsets[1] = -1;
s->channel_offsets[2] = -1;
s->channel_offsets[3] = -1;
s->bits_per_color_id = -1;
if (buf_end - buf < 10) {
@@ -209,6 +210,8 @@ static int decode_frame(AVCodecContext *avctx,
channel_index = 1;
if (!strcmp(buf, "B"))
channel_index = 2;
if (!strcmp(buf, "A"))
channel_index = 3;
while (bytestream_get_byte(&buf) && buf < channel_list_end)
continue; /* skip */
@@ -302,9 +305,9 @@ static int decode_frame(AVCodecContext *avctx,
if (!variable_buffer_data_size)
return -1;
switch (*buf) {
s->compr = *buf;
switch (s->compr) {
case EXR_RAW:
s->compr = *buf;
break;
case EXR_RLE:
case EXR_ZIP1:
@@ -312,7 +315,7 @@ static int decode_frame(AVCodecContext *avctx,
case EXR_PIZ:
case EXR_B44:
default:
av_log(avctx, AV_LOG_ERROR, "This type of compression is not supported\n");
av_log(avctx, AV_LOG_ERROR, "Compression type %d is not supported\n", s->compr);
return -1;
}
@@ -354,7 +357,10 @@ static int decode_frame(AVCodecContext *avctx,
switch (s->bits_per_color_id) {
case 2: // 32-bit
case 1: // 16-bit
avctx->pix_fmt = PIX_FMT_RGB48;
if (s->channel_offsets[3] >= 0)
avctx->pix_fmt = PIX_FMT_RGBA64;
else
avctx->pix_fmt = PIX_FMT_RGB48;
break;
// 8-bit
case 0:
@@ -390,7 +396,7 @@ static int decode_frame(AVCodecContext *avctx,
// Zero out the start if ymin is not 0
for (y = 0; y < ymin; y++) {
memset(ptr, 0, avctx->width * 6);
memset(ptr, 0, avctx->width * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
ptr += stride;
}
@@ -405,21 +411,27 @@ static int decode_frame(AVCodecContext *avctx,
if (line_offset > avpkt->size - xdelta * current_channel_offset) {
// Line offset is probably wrong and not inside the buffer
av_log(avctx, AV_LOG_WARNING, "Line offset for line %d is out of reach setting it to black\n", y);
memset(ptr_x, 0, avctx->width * 6);
memset(ptr_x, 0, avctx->width * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
} else {
const uint8_t *red_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[0];
const uint8_t *green_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[1];
const uint8_t *blue_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[2];
const uint8_t *alpha_channel_buffer = 0;
if (s->channel_offsets[3] >= 0)
alpha_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[3];
// Zero out the start if xmin is not 0
memset(ptr_x, 0, xmin * 6);
ptr_x += xmin * 3;
memset(ptr_x, 0, xmin * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
ptr_x += xmin * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components;
if (s->bits_per_color_id == 2) {
// 32-bit
for (x = 0; x < xdelta; x++) {
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&red_channel_buffer));
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&green_channel_buffer));
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&blue_channel_buffer));
if (alpha_channel_buffer)
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&alpha_channel_buffer));
}
} else {
// 16-bit
@@ -427,12 +439,14 @@ static int decode_frame(AVCodecContext *avctx,
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&red_channel_buffer));
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&green_channel_buffer));
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&blue_channel_buffer));
if (alpha_channel_buffer)
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&alpha_channel_buffer));
}
}
// Zero out the end if xmax+1 is not w
memset(ptr_x, 0, (avctx->width - (xmax + 1)) * 6);
ptr_x += (avctx->width - (xmax + 1)) * 3;
memset(ptr_x, 0, (avctx->width - (xmax + 1)) * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
ptr_x += (avctx->width - (xmax + 1)) * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components;
}
// Move to next line
@@ -442,7 +456,7 @@ static int decode_frame(AVCodecContext *avctx,
// Zero out the end if ymax+1 is not h
for (y = ymax + 1; y < avctx->height; y++) {
memset(ptr, 0, avctx->width * 6);
memset(ptr, 0, avctx->width * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
ptr += stride;
}

View File

@@ -1651,9 +1651,9 @@ static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale){
memset(state, 128, sizeof(state));
for(v=0; i<128 ; v++){
int len= get_symbol(c, state, 0) + 1;
unsigned len= get_symbol(c, state, 0) + 1;
if(len + i > 128) return -1;
if(len > 128 - i) return -1;
while(len--){
quant_table[i] = scale*v;
@@ -1697,8 +1697,10 @@ static int read_extra_header(FFV1Context *f){
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
f->version= get_symbol(c, state, 0);
if(f->version > 2)
if(f->version > 2) {
c->bytestream_end -= 4;
f->minor_version= get_symbol(c, state, 0);
}
f->ac= f->avctx->coder_type= get_symbol(c, state, 0);
if(f->ac>1){
for(i=1; i<256; i++){
@@ -1767,7 +1769,12 @@ static int read_header(FFV1Context *f){
memset(state, 128, sizeof(state));
if(f->version < 2){
f->version= get_symbol(c, state, 0);
unsigned v= get_symbol(c, state, 0);
if(v >= 2){
av_log(f->avctx, AV_LOG_ERROR, "invalid version %d in ver01 header\n", v);
return AVERROR_INVALIDDATA;
}
f->version = v;
f->ac= f->avctx->coder_type= get_symbol(c, state, 0);
if(f->ac>1){
for(i=1; i<256; i++){
@@ -1984,7 +1991,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
}
if(avctx->debug&FF_DEBUG_PICT_INFO)
av_log(avctx, AV_LOG_ERROR, "keyframe:%d coder:%d\n", p->key_frame, f->ac);
av_log(avctx, AV_LOG_DEBUG, "ver:%d keyframe:%d coder:%d ec:%d slices:%d\n",
f->version, p->key_frame, f->ac, f->ec, f->slice_count);
buf_p= buf + buf_size;
for(i=f->slice_count-1; i>=0; i--){

View File

@@ -161,17 +161,17 @@ static int decode_frame(AVCodecContext *avctx,
unsigned needed_size = avctx->width*avctx->height*3;
if (version == 0) needed_size /= 2;
needed_size += header_size;
if (buf_size != needed_size && buf_size != header_size) {
av_log(avctx, AV_LOG_ERROR,
"Invalid frame length %d (should be %d)\n",
buf_size, needed_size);
return -1;
}
/* bit 31 means same as previous pic */
if (header & (1U<<31)) {
*data_size = 0;
return buf_size;
}
if (buf_size != needed_size) {
av_log(avctx, AV_LOG_ERROR,
"Invalid frame length %d (should be %d)\n",
buf_size, needed_size);
return -1;
}
} else {
/* skip frame */
if (buf_size == 8) {

View File

@@ -145,6 +145,11 @@ static av_cold int gif_encode_init(AVCodecContext *avctx)
{
GIFContext *s = avctx->priv_data;
if (avctx->width > 65535 || avctx->height > 65535) {
av_log(avctx, AV_LOG_ERROR, "GIF does not support resolutions above 65535x65535\n");
return -1;
}
avctx->coded_frame = &s->picture;
s->lzw = av_mallocz(ff_lzw_encode_state_size);
if (!s->lzw)

View File

@@ -1615,7 +1615,7 @@ static void decode_postinit(H264Context *h, int setup_finished)
|| (h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > INT_MIN && h->last_pocs[MAX_DELAYED_PIC_COUNT-1] - h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > 2))
out_of_order = FFMAX(out_of_order, 1);
if(s->avctx->has_b_frames < out_of_order && !h->sps.bitstream_restriction_flag){
av_log(s->avctx, AV_LOG_WARNING, "Increasing reorder buffer to %d\n", out_of_order);
av_log(s->avctx, AV_LOG_VERBOSE, "Increasing reorder buffer to %d\n", out_of_order);
s->avctx->has_b_frames = out_of_order;
s->low_delay = 0;
}
@@ -2719,19 +2719,19 @@ static void init_scan_tables(H264Context *h)
#undef T
}
if (h->sps.transform_bypass) { // FIXME same ugly
h->zigzag_scan_q0 = zigzag_scan;
h->zigzag_scan8x8_q0 = ff_zigzag_direct;
h->zigzag_scan8x8_cavlc_q0 = zigzag_scan8x8_cavlc;
h->field_scan_q0 = field_scan;
h->field_scan8x8_q0 = field_scan8x8;
h->field_scan8x8_cavlc_q0 = field_scan8x8_cavlc;
memcpy(h->zigzag_scan_q0 , zigzag_scan , sizeof(h->zigzag_scan_q0 ));
memcpy(h->zigzag_scan8x8_q0 , ff_zigzag_direct , sizeof(h->zigzag_scan8x8_q0 ));
memcpy(h->zigzag_scan8x8_cavlc_q0 , zigzag_scan8x8_cavlc , sizeof(h->zigzag_scan8x8_cavlc_q0));
memcpy(h->field_scan_q0 , field_scan , sizeof(h->field_scan_q0 ));
memcpy(h->field_scan8x8_q0 , field_scan8x8 , sizeof(h->field_scan8x8_q0 ));
memcpy(h->field_scan8x8_cavlc_q0 , field_scan8x8_cavlc , sizeof(h->field_scan8x8_cavlc_q0 ));
} else {
h->zigzag_scan_q0 = h->zigzag_scan;
h->zigzag_scan8x8_q0 = h->zigzag_scan8x8;
h->zigzag_scan8x8_cavlc_q0 = h->zigzag_scan8x8_cavlc;
h->field_scan_q0 = h->field_scan;
h->field_scan8x8_q0 = h->field_scan8x8;
h->field_scan8x8_cavlc_q0 = h->field_scan8x8_cavlc;
memcpy(h->zigzag_scan_q0 , h->zigzag_scan , sizeof(h->zigzag_scan_q0 ));
memcpy(h->zigzag_scan8x8_q0 , h->zigzag_scan8x8 , sizeof(h->zigzag_scan8x8_q0 ));
memcpy(h->zigzag_scan8x8_cavlc_q0 , h->zigzag_scan8x8_cavlc , sizeof(h->zigzag_scan8x8_cavlc_q0));
memcpy(h->field_scan_q0 , h->field_scan , sizeof(h->field_scan_q0 ));
memcpy(h->field_scan8x8_q0 , h->field_scan8x8 , sizeof(h->field_scan8x8_q0 ));
memcpy(h->field_scan8x8_cavlc_q0 , h->field_scan8x8_cavlc , sizeof(h->field_scan8x8_cavlc_q0 ));
}
}
@@ -4032,7 +4032,9 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
loop_filter(h, lf_x_start, s->mb_x + 1);
return 0;
}
if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 2) {
if (h->cabac.bytestream > h->cabac.bytestream_end + 2 )
av_log(h->s.avctx, AV_LOG_DEBUG, "bytestream overread %td\n", h->cabac.bytestream_end - h->cabac.bytestream);
if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 4) {
av_log(h->s.avctx, AV_LOG_ERROR,
"error while decoding MB %d %d, bytestream (%td)\n",
s->mb_x, s->mb_y,
@@ -4399,6 +4401,9 @@ again:
init_get_bits(&hx->inter_gb, ptr, bit_length);
hx->inter_gb_ptr = &hx->inter_gb;
av_log(h->s.avctx, AV_LOG_ERROR, "Partitioned H.264 support is incomplete\n");
return AVERROR_PATCHWELCOME;
if (hx->redundant_pic_count == 0 &&
hx->intra_gb_ptr &&
hx->s.data_partitioning &&

View File

@@ -421,12 +421,12 @@ typedef struct H264Context {
uint8_t field_scan[16];
uint8_t field_scan8x8[64];
uint8_t field_scan8x8_cavlc[64];
const uint8_t *zigzag_scan_q0;
const uint8_t *zigzag_scan8x8_q0;
const uint8_t *zigzag_scan8x8_cavlc_q0;
const uint8_t *field_scan_q0;
const uint8_t *field_scan8x8_q0;
const uint8_t *field_scan8x8_cavlc_q0;
uint8_t zigzag_scan_q0[16];
uint8_t zigzag_scan8x8_q0[64];
uint8_t zigzag_scan8x8_cavlc_q0[64];
uint8_t field_scan_q0[16];
uint8_t field_scan8x8_q0[64];
uint8_t field_scan8x8_cavlc_q0[64];
int x264_build;

View File

@@ -513,7 +513,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
else
level_code= prefix + get_bits(gb, 4); //part
}else{
level_code= 30 + get_bits(gb, prefix-3); //part
level_code= 30;
if(prefix>=16){
if(prefix > 25+3){
av_log(h->s.avctx, AV_LOG_ERROR, "Invalid level prefix\n");
@@ -521,6 +521,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
}
level_code += (1<<(prefix-3))-4096;
}
level_code += get_bits(gb, prefix-3); //part
}
if(trailing_ones < 3) level_code += 2;

View File

@@ -52,14 +52,14 @@ static const uint8_t golomb_to_inter_cbp[48] = {
17, 18, 20, 24, 19, 21, 26, 28, 23, 27, 29, 30, 22, 25, 38, 41
};
static const uint8_t zigzag_scan[16] = {
static const uint8_t zigzag_scan[16+1] = {
0 + 0 * 4, 1 + 0 * 4, 0 + 1 * 4, 0 + 2 * 4,
1 + 1 * 4, 2 + 0 * 4, 3 + 0 * 4, 2 + 1 * 4,
1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4,
3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 4,
};
static const uint8_t field_scan[16] = {
static const uint8_t field_scan[16+1] = {
0 + 0 * 4, 0 + 1 * 4, 1 + 0 * 4, 0 + 2 * 4,
0 + 3 * 4, 1 + 1 * 4, 1 + 2 * 4, 1 + 3 * 4,
2 + 0 * 4, 2 + 1 * 4, 2 + 2 * 4, 2 + 3 * 4,
@@ -93,7 +93,7 @@ static const uint8_t chroma422_dc_scan[8] = {
};
// zigzag_scan8x8_cavlc[i] = zigzag_scan8x8[(i/4) + 16*(i%4)]
static const uint8_t zigzag_scan8x8_cavlc[64] = {
static const uint8_t zigzag_scan8x8_cavlc[64+1] = {
0 + 0 * 8, 1 + 1 * 8, 1 + 2 * 8, 2 + 2 * 8,
4 + 1 * 8, 0 + 5 * 8, 3 + 3 * 8, 7 + 0 * 8,
3 + 4 * 8, 1 + 7 * 8, 5 + 3 * 8, 6 + 3 * 8,
@@ -112,7 +112,7 @@ static const uint8_t zigzag_scan8x8_cavlc[64] = {
5 + 5 * 8, 6 + 5 * 8, 6 + 6 * 8, 7 + 7 * 8,
};
static const uint8_t field_scan8x8[64] = {
static const uint8_t field_scan8x8[64+1] = {
0 + 0 * 8, 0 + 1 * 8, 0 + 2 * 8, 1 + 0 * 8,
1 + 1 * 8, 0 + 3 * 8, 0 + 4 * 8, 1 + 2 * 8,
2 + 0 * 8, 1 + 3 * 8, 0 + 5 * 8, 0 + 6 * 8,
@@ -131,7 +131,7 @@ static const uint8_t field_scan8x8[64] = {
7 + 4 * 8, 7 + 5 * 8, 7 + 6 * 8, 7 + 7 * 8,
};
static const uint8_t field_scan8x8_cavlc[64] = {
static const uint8_t field_scan8x8_cavlc[64+1] = {
0 + 0 * 8, 1 + 1 * 8, 2 + 0 * 8, 0 + 7 * 8,
2 + 2 * 8, 2 + 3 * 8, 2 + 4 * 8, 3 + 3 * 8,
3 + 4 * 8, 4 + 3 * 8, 4 + 4 * 8, 5 + 3 * 8,

View File

@@ -191,7 +191,13 @@ static int extract_header(AVCodecContext *const avctx,
const uint8_t *buf;
unsigned buf_size;
IffContext *s = avctx->priv_data;
int palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
int palette_size;
if (avctx->extradata_size < 2) {
av_log(avctx, AV_LOG_ERROR, "not enough extradata\n");
return AVERROR_INVALIDDATA;
}
palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
if (avpkt) {
int image_size;
@@ -207,8 +213,6 @@ static int extract_header(AVCodecContext *const avctx,
return AVERROR_INVALIDDATA;
}
} else {
if (avctx->extradata_size < 2)
return AVERROR_INVALIDDATA;
buf = avctx->extradata;
buf_size = bytestream_get_be16(&buf);
if (buf_size <= 1 || palette_size < 0) {
@@ -312,7 +316,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
int err;
if (avctx->bits_per_coded_sample <= 8) {
int palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
int palette_size;
if (avctx->extradata_size >= 2)
palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
else
palette_size = 0;
avctx->pix_fmt = (avctx->bits_per_coded_sample < 8) ||
(avctx->extradata_size >= 2 && palette_size) ? PIX_FMT_PAL8 : PIX_FMT_GRAY8;
} else if (avctx->bits_per_coded_sample <= 32) {

View File

@@ -199,6 +199,10 @@ static int decode_gop_header(IVI45DecContext *ctx, AVCodecContext *avctx)
}
if (band->blk_size == 8) {
if(quant_mat >= 5){
av_log(avctx, AV_LOG_ERROR, "quant_mat %d too large!\n", quant_mat);
return -1;
}
band->intra_base = &ivi5_base_quant_8x8_intra[quant_mat][0];
band->inter_base = &ivi5_base_quant_8x8_inter[quant_mat][0];
band->intra_scale = &ivi5_scale_quant_8x8_intra[quant_mat][0];

View File

@@ -77,7 +77,7 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
}
if(get_bits(&s->gb, 2))
av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
s->loop_filter = get_bits1(&s->gb);
s->loop_filter = get_bits1(&s->gb) * !s->avctx->lowres;
if(get_bits1(&s->gb))
av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
if(get_bits1(&s->gb))

View File

@@ -963,6 +963,8 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */
s->loop_filter= get_bits1(&s->gb);
s->unrestricted_mv = s->umvplus || s->obmc || s->loop_filter;
if(s->avctx->lowres)
s->loop_filter = 0;
s->h263_slice_structured= get_bits1(&s->gb);
if (get_bits1(&s->gb) != 0) {

View File

@@ -143,6 +143,10 @@ static int decode_frame(AVCodecContext *avctx,
buf += 5;
if (video_size) {
if(video_size < 0) {
av_log(avctx, AV_LOG_ERROR, "video size %d invalid\n", video_size);
return AVERROR_INVALIDDATA;
}
if (avctx->reget_buffer(avctx, &s->frame) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;

View File

@@ -304,7 +304,8 @@ AVCodec ff_libmp3lame_encoder = {
AV_SAMPLE_FMT_NONE },
.supported_samplerates = libmp3lame_sample_rates,
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO },
AV_CH_LAYOUT_STEREO,
0},
.long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
.priv_class = &libmp3lame_class,
.defaults = libmp3lame_defaults,

View File

@@ -231,7 +231,7 @@ static av_cold int mace_decode_init(AVCodecContext * avctx)
{
MACEContext *ctx = avctx->priv_data;
if (avctx->channels > 2)
if (avctx->channels > 2 || avctx->channels <= 0)
return -1;
avctx->sample_fmt = AV_SAMPLE_FMT_S16;

View File

@@ -55,6 +55,11 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
int w4 = (avctx->width + 3) & ~3;
int h4 = (avctx->height + 3) & ~3;
if(avctx->extradata_size < 2){
av_log(avctx, AV_LOG_ERROR, "extradata too small\n");
return AVERROR_INVALIDDATA;
}
motionpixels_tableinit();
mp->avctx = avctx;
ff_dsputil_init(&mp->dsp, avctx);

View File

@@ -228,7 +228,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
buf_size -= 4;
/* get output buffer */
c->frame.nb_samples = last_frame ? c->lastframelen : MPC_FRAME_SIZE;
c->frame.nb_samples = MPC_FRAME_SIZE;
if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
@@ -298,6 +298,8 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
idx_to_quant(c, &gb, bands[i].res[ch], c->Q[ch] + off);
ff_mpc_dequantize_and_synth(c, mb, c->frame.data[0], 2);
if(last_frame)
c->frame.nb_samples = c->lastframelen;
bits_used = get_bits_count(&gb);
bits_avail = buf_size * 8;

View File

@@ -140,7 +140,8 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
c->frames = 1 << (get_bits(&gb, 3) * 2);
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
avctx->channel_layout = (channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
avctx->channels = channels;
if(vlc_initialized) return 0;
av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
@@ -274,7 +275,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
maxband = c->last_max_band + get_vlc2(gb, band_vlc.table, MPC8_BANDS_BITS, 2);
if(maxband > 32) maxband -= 33;
}
if(maxband >= BANDS) {
if(maxband > c->maxbands + 1) {
av_log(avctx, AV_LOG_ERROR, "maxband %d too large\n",maxband);
return AVERROR_INVALIDDATA;
}
@@ -411,7 +412,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
}
}
ff_mpc_dequantize_and_synth(c, maxband, c->frame.data[0], avctx->channels);
ff_mpc_dequantize_and_synth(c, maxband - 1, c->frame.data[0],
avctx->channels);
c->cur_frame++;

View File

@@ -2050,6 +2050,10 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
if(s->pict_type == AV_PICTURE_TYPE_B)
skip_bits_long(gb, s->cplx_estimation_trash_b);
if(get_bits_left(gb) < 3) {
av_log(s->avctx, AV_LOG_ERROR, "Header truncated\n");
return -1;
}
s->intra_dc_threshold= ff_mpeg4_dc_threshold[ get_bits(gb, 3) ];
if(!s->progressive_sequence){
s->top_field_first= get_bits1(gb);

View File

@@ -1436,7 +1436,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
y = (x * f) >> 16;
fr = (x * f) & 0xFFFF;
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16;
buf[(y + 1) * stride + x] += (color * fr ) >> 16;
if(fr) buf[(y + 1) * stride + x] += (color * fr ) >> 16;
}
} else {
if (sy > ey) {
@@ -1453,7 +1453,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
x = (y*f) >> 16;
fr = (y*f) & 0xFFFF;
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16;
buf[y * stride + x + 1] += (color * fr ) >> 16;
if(fr) buf[y * stride + x + 1] += (color * fr ) >> 16;
}
}
}

View File

@@ -45,6 +45,8 @@ static int png_parse(AVCodecParserContext *s, AVCodecContext *avctx,
int next = END_NOT_FOUND;
int i = 0;
s->pict_type = AV_PICTURE_TYPE_NONE;
*poutbuf_size = 0;
if (buf_size == 0)
return 0;

View File

@@ -29,7 +29,7 @@
#define CLIP_AND_BIAS(x) (av_clip((x) + BIAS, CLIP_MIN, CLIP_MAX))
#if CONFIG_PRORES_DECODER
#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER
/**
* Add bias value, clamp and output pixels of a slice
*/
@@ -53,7 +53,7 @@ static void prores_idct_put_c(uint16_t *out, int linesize, DCTELEM *block, const
}
#endif
#if CONFIG_PRORES_ENCODER
#if CONFIG_PRORES_KOSTYA_ENCODER
static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block)
{
int x, y;
@@ -70,7 +70,7 @@ static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block)
void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
{
#if CONFIG_PRORES_DECODER
#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER
dsp->idct_put = prores_idct_put_c;
dsp->idct_permutation_type = FF_NO_IDCT_PERM;
@@ -79,7 +79,7 @@ void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
ff_init_scantable_permutation(dsp->idct_permutation,
dsp->idct_permutation_type);
#endif
#if CONFIG_PRORES_ENCODER
#if CONFIG_PRORES_KOSTYA_ENCODER
dsp->fdct = prores_fdct_c;
dsp->dct_permutation_type = FF_NO_IDCT_PERM;
ff_init_scantable_permutation(dsp->dct_permutation,

View File

@@ -1363,7 +1363,8 @@ static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *
if (q->superblocktype_2_3) {
while ((n = qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2)) < 2) {
if (get_bits_left(gb)<0) {
av_log(0, AV_LOG_ERROR, "overread in qdm2_fft_decode_tones()\n");
if(local_int_4 < q->group_size)
av_log(0, AV_LOG_ERROR, "overread in qdm2_fft_decode_tones()\n");
return;
}
offset = 1;

View File

@@ -41,7 +41,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int h, w;
AVFrame *pic = avctx->coded_frame;
const uint32_t *src = (const uint32_t *)avpkt->data;
int aligned_width = FFALIGN(avctx->width, 64);
int aligned_width = FFALIGN(avctx->width,
avctx->codec_id == CODEC_ID_R10K ? 1 : 64);
uint8_t *dst_line;
if (pic->data[0])

View File

@@ -38,7 +38,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pic, int *got_packet)
{
int i, j, ret;
int aligned_width = FFALIGN(avctx->width, 64);
int aligned_width = FFALIGN(avctx->width,
avctx->codec_id == CODEC_ID_R10K ? 1 : 64);
int pad = (aligned_width - avctx->width) * 4;
uint8_t *src_line;
uint8_t *dst;

View File

@@ -349,7 +349,7 @@ static int rv20_decode_picture_header(RVDecContext *rv)
}
if(RV_GET_MINOR_VER(rv->sub_id) >= 2)
s->loop_filter = get_bits1(&s->gb);
s->loop_filter = get_bits1(&s->gb) && !s->avctx->lowres;
if(RV_GET_MINOR_VER(rv->sub_id) <= 1)
seq = get_bits(&s->gb, 8) << 7;

View File

@@ -36,6 +36,11 @@ static av_cold int encode_init(AVCodecContext *avctx)
{
SgiContext *s = avctx->priv_data;
if (avctx->width > 65535 || avctx->height > 65535) {
av_log(avctx, AV_LOG_ERROR, "SGI does not support resolutions above 65535x65535\n");
return -1;
}
avcodec_get_frame_defaults(&s->picture);
avctx->coded_frame = &s->picture;

View File

@@ -512,6 +512,10 @@ hres,vres,i,i%vres (0 < i < 4)
}
#define APPLY_C_PREDICTOR() \
if(index > 1023){\
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
return; \
}\
predictor_pair = s->c_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
@@ -529,6 +533,10 @@ hres,vres,i,i%vres (0 < i < 4)
index++;
#define APPLY_C_PREDICTOR_24() \
if(index > 1023){\
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
return; \
}\
predictor_pair = s->c_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
@@ -547,6 +555,10 @@ hres,vres,i,i%vres (0 < i < 4)
#define APPLY_Y_PREDICTOR() \
if(index > 1023){\
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
return; \
}\
predictor_pair = s->y_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
@@ -564,6 +576,10 @@ hres,vres,i,i%vres (0 < i < 4)
index++;
#define APPLY_Y_PREDICTOR_24() \
if(index > 1023){\
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
return; \
}\
predictor_pair = s->y_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \

View File

@@ -789,7 +789,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
if (codec->capabilities & CODEC_CAP_EXPERIMENTAL)
if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
av_log(avctx, AV_LOG_ERROR, "Codec is experimental but experimental codecs are not enabled, see -strict -2\n");
av_log(avctx, AV_LOG_ERROR, "Codec is experimental but experimental codecs are not enabled, try -strict -2\n");
ret = -1;
goto free_and_end;
}
@@ -2194,8 +2194,12 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
/* calc from frame_bytes, channels, and bits_per_coded_sample */
switch (avctx->codec_id) {
case CODEC_ID_PCM_DVD:
if(bps<4)
return 0;
return 2 * (frame_bytes / ((bps * 2 / 8) * ch));
case CODEC_ID_PCM_BLURAY:
if(bps<4)
return 0;
return frame_bytes / ((FFALIGN(ch, 2) * bps) / 8);
case CODEC_ID_S302M:
return 2 * (frame_bytes / ((bps + 4) / 4)) / ch;

View File

@@ -70,6 +70,11 @@ static int decode_frame(AVCodecContext *avctx,
int prev_y = 0, prev_u = 0, prev_v = 0;
uint8_t *rbuf;
if(buf_size<=8) {
av_log(avctx, AV_LOG_ERROR, "buf_size %d is too small\n", buf_size);
return AVERROR_INVALIDDATA;
}
rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
if(!rbuf){
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");

View File

@@ -517,6 +517,10 @@ static int xan_decode_frame(AVCodecContext *avctx,
int i;
tag = bytestream_get_le32(&buf);
size = bytestream_get_be32(&buf);
if(size < 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid tag size %d\n", size);
return AVERROR_INVALIDDATA;
}
size = FFMIN(size, buf_end - buf);
switch (tag) {
case PALT_TAG:

View File

@@ -89,6 +89,11 @@ static av_cold int yop_decode_init(AVCodecContext *avctx)
return -1;
}
if (!avctx->extradata) {
av_log(avctx, AV_LOG_ERROR, "extradata missing\n");
return AVERROR_INVALIDDATA;
}
avctx->pix_fmt = PIX_FMT_PAL8;
avcodec_get_frame_defaults(&s->frame);
@@ -199,6 +204,11 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if (s->frame.data[0])
avctx->release_buffer(avctx, &s->frame);
if (avpkt->size < 4 + 3*s->num_pal_colors) {
av_log(avctx, AV_LOG_ERROR, "packet of size %d too small\n", avpkt->size);
return AVERROR_INVALIDDATA;
}
ret = avctx->get_buffer(avctx, &s->frame);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
@@ -214,6 +224,10 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
s->low_nibble = NULL;
is_odd_frame = avpkt->data[0];
if(is_odd_frame>1){
av_log(avctx, AV_LOG_ERROR, "frame is too odd %d\n", is_odd_frame);
return AVERROR_INVALIDDATA;
}
firstcolor = s->first_color[is_odd_frame];
palette = (uint32_t *)s->frame.data[1];

View File

@@ -37,6 +37,7 @@ typedef struct {
double ratio;
struct SwrContext *swr;
int64_t next_pts;
int req_fullfilled;
} AResampleContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
@@ -173,31 +174,9 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
AVFilterLink *const outlink = inlink->dst->outputs[0];
AVFilterBufferRef *outsamplesref = ff_get_audio_buffer(outlink, AV_PERM_WRITE, n_out);
n_out = swr_convert(aresample->swr, outsamplesref->extended_data, n_out,
(void *)insamplesref->extended_data, n_in);
if (n_out <= 0) {
avfilter_unref_buffer(outsamplesref);
avfilter_unref_buffer(insamplesref);
return;
}
avfilter_copy_buffer_ref_props(outsamplesref, insamplesref);
outsamplesref->audio->sample_rate = outlink->sample_rate;
outsamplesref->audio->nb_samples = n_out;
#if 0
if(insamplesref->pts != AV_NOPTS_VALUE) {
aresample->next_pts =
outsamplesref->pts = av_rescale_q(insamplesref->pts, inlink->time_base, outlink->time_base)
- swr_get_delay(aresample->swr, outlink->time_base.den);
av_assert0(outlink->time_base.num == 1);
} else{
outsamplesref->pts = AV_NOPTS_VALUE; //aresample->next_pts;
}
if(aresample->next_pts != AV_NOPTS_VALUE)
aresample->next_pts += av_rescale_q(n_out, (AVRational){1 ,outlink->sample_rate}, outlink->time_base);
#else
if(insamplesref->pts != AV_NOPTS_VALUE) {
int64_t inpts = av_rescale(insamplesref->pts, inlink->time_base.num * (int64_t)outlink->sample_rate * inlink->sample_rate, inlink->time_base.den);
int64_t outpts= swr_next_pts(aresample->swr, inpts);
@@ -206,8 +185,20 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
} else {
outsamplesref->pts = AV_NOPTS_VALUE;
}
#endif
n_out = swr_convert(aresample->swr, outsamplesref->extended_data, n_out,
(void *)insamplesref->extended_data, n_in);
if (n_out <= 0) {
avfilter_unref_buffer(outsamplesref);
avfilter_unref_buffer(insamplesref);
return;
}
outsamplesref->audio->sample_rate = outlink->sample_rate;
outsamplesref->audio->nb_samples = n_out;
ff_filter_samples(outlink, outsamplesref);
aresample->req_fullfilled= 1;
avfilter_unref_buffer(insamplesref);
}
@@ -216,7 +207,12 @@ static int request_frame(AVFilterLink *outlink)
AVFilterContext *ctx = outlink->src;
AResampleContext *aresample = ctx->priv;
AVFilterLink *const inlink = outlink->src->inputs[0];
int ret = avfilter_request_frame(ctx->inputs[0]);
int ret;
aresample->req_fullfilled = 0;
do{
ret = avfilter_request_frame(ctx->inputs[0]);
}while(!aresample->req_fullfilled && ret>=0);
if (ret == AVERROR_EOF) {
AVFilterBufferRef *outsamplesref;

View File

@@ -59,10 +59,13 @@ int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
return AVERROR(EINVAL);
memcpy(frame->data, samplesref->data, sizeof(frame->data));
frame->pkt_pos = samplesref->pos;
frame->format = samplesref->format;
frame->nb_samples = samplesref->audio->nb_samples;
frame->pts = samplesref->pts;
memcpy(frame->linesize, samplesref->linesize, sizeof(frame->linesize));
av_frame_set_pkt_pos(frame, samplesref->pos);
frame->format = samplesref->format;
frame->nb_samples = samplesref->audio->nb_samples;
frame->pts = samplesref->pts;
frame->sample_rate = samplesref->audio->sample_rate;
frame->channel_layout = samplesref->audio->channel_layout;
return 0;
}
@@ -75,7 +78,7 @@ int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
memcpy(frame->data, picref->data, sizeof(frame->data));
memcpy(frame->linesize, picref->linesize, sizeof(frame->linesize));
frame->pkt_pos = picref->pos;
av_frame_set_pkt_pos(frame, picref->pos);
frame->interlaced_frame = picref->video->interlaced;
frame->top_field_first = picref->video->top_field_first;
frame->key_frame = picref->video->key_frame;

View File

@@ -166,7 +166,7 @@ void avfilter_unref_bufferp(AVFilterBufferRef **ref)
int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
{
dst->pts = src->pts;
dst->pos = src->pkt_pos;
dst->pos = av_frame_get_pkt_pos(src);
dst->format = src->format;
switch (dst->type) {

View File

@@ -200,6 +200,11 @@ static int fourxm_read_header(AVFormatContext *s)
ret = AVERROR_INVALIDDATA;
goto fail;
}
if(!fourxm->tracks[current_track].adpcm && fourxm->tracks[current_track].bits<8){
av_log(s, AV_LOG_ERROR, "bits unspecified for non ADPCM\n");
ret = AVERROR_INVALIDDATA;
goto fail;
}
i += 8 + size;
/* allocate a new AVStream */

View File

@@ -163,7 +163,7 @@ OBJS-$(CONFIG_MOV_DEMUXER) += mov.o isom.o mov_chan.o
OBJS-$(CONFIG_MOV_MUXER) += movenc.o isom.o avc.o \
movenchint.o rtpenc_chain.o \
mov_chan.o
OBJS-$(CONFIG_MP2_MUXER) += mp3enc.o rawenc.o
OBJS-$(CONFIG_MP2_MUXER) += mp3enc.o rawenc.o id3v2enc.o
OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o
OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o
OBJS-$(CONFIG_MPC_DEMUXER) += mpc.o apetag.o

View File

@@ -37,6 +37,8 @@ static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
end = buf + p->buf_size;
for(; buf < end; buf++) {
if(buf > p->buf && (buf[0] != 0x0B || buf[1] != 0x77) )
continue;
buf2 = buf;
for(frames = 0; buf2 < end; frames++) {

View File

@@ -278,6 +278,9 @@ static int ape_read_header(AVFormatContext * s)
return AVERROR(ENOMEM);
for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++)
ape->seektable[i] = avio_rl32(pb);
}else{
av_log(s, AV_LOG_ERROR, "Missing seektable\n");
return -1;
}
ape->frames[0].pos = ape->firstframe;

View File

@@ -578,6 +578,7 @@ static int avi_read_header(AVFormatContext *s)
avio_skip(pb, size);
} else {
uint64_t cur_pos = avio_tell(pb);
unsigned esize;
if (cur_pos < list_end)
size = FFMIN(size, list_end - cur_pos);
st = s->streams[stream_index];
@@ -591,7 +592,7 @@ static int avi_read_header(AVFormatContext *s)
avio_skip(pb, size);
break;
}
tag1 = ff_get_bmp_header(pb, st);
tag1 = ff_get_bmp_header(pb, st, &esize);
if (tag1 == MKTAG('D', 'X', 'S', 'B') || tag1 == MKTAG('D','X','S','A')) {
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
@@ -601,7 +602,8 @@ static int avi_read_header(AVFormatContext *s)
}
if(size > 10*4 && size<(1<<30) && size < avi->fsize){
st->codec->extradata_size= size - 10*4;
if(esize == size-1 && (esize&1)) st->codec->extradata_size= esize - 10*4;
else st->codec->extradata_size= size - 10*4;
st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata) {
st->codec->extradata_size= 0;

View File

@@ -255,9 +255,12 @@ static int avi_write_header(AVFormatContext *s)
ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
if(stream->codec_id == CODEC_ID_XSUB)
au_scale = au_byterate = 0;
avio_wl32(pb, au_scale); /* scale */
avio_wl32(pb, au_byterate); /* rate */
avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
avio_wl32(pb, 0); /* start */
avist->frames_hdr_strm = avio_tell(pb); /* remember this offset to fill later */
@@ -521,7 +524,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
int size= pkt->size;
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d %d\n", pkt->dts, avist->packet_count, stream_index);
while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count){
while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != CODEC_ID_XSUB){
AVPacket empty_packet;
if(pkt->dts - avist->packet_count > 60000){

View File

@@ -55,7 +55,7 @@ static int avisynth_read_header(AVFormatContext *s)
res = AVIFileOpen(&avs->file, s->filename, OF_READ|OF_SHARE_DENY_WRITE, NULL);
if (res != S_OK)
{
av_log(s, AV_LOG_ERROR, "AVIFileOpen failed with error %ld", res);
av_log(s, AV_LOG_ERROR, "AVIFileOpen failed with error %ld\n", res);
AVIFileExit();
return -1;
}
@@ -63,7 +63,7 @@ static int avisynth_read_header(AVFormatContext *s)
res = AVIFileInfo(avs->file, &info, sizeof(info));
if (res != S_OK)
{
av_log(s, AV_LOG_ERROR, "AVIFileInfo failed with error %ld", res);
av_log(s, AV_LOG_ERROR, "AVIFileInfo failed with error %ld\n", res);
AVIFileExit();
return -1;
}

View File

@@ -273,9 +273,6 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
c->sys->time_base.den);
avctx->time_base= c->sys->time_base;
if (!avctx->width)
avcodec_set_dimensions(avctx, c->sys->width, c->sys->height);
avctx->pix_fmt = c->sys->pix_fmt;
/* finding out SAR is a little bit messy */
vsc_pack = dv_extract_pack(frame, dv_video_control);

View File

@@ -529,8 +529,9 @@ static int ipmovie_probe(AVProbeData *p)
uint8_t *b = p->buf;
uint8_t *b_end = p->buf + p->buf_size - sizeof(signature);
do {
if (memcmp(b++, signature, sizeof(signature)) == 0)
if (b[0] == signature[0] && memcmp(b, signature, sizeof(signature)) == 0)
return AVPROBE_SCORE_MAX;
b++;
} while (b < b_end);
return 0;

View File

@@ -63,10 +63,13 @@ static int jacosub_probe(AVProbeData *p)
ptr += 3; /* skip UTF-8 BOM */
while (ptr < ptr_end) {
if (timed_line(ptr))
return AVPROBE_SCORE_MAX / 2;
while (jss_whitespace(*ptr))
ptr++;
if (*ptr != '#' && *ptr != '\n') {
if (timed_line(ptr))
return AVPROBE_SCORE_MAX/2 + 1;
return 0;
}
ptr += strcspn(ptr, "\n") + 1;
}
return 0;

View File

@@ -1874,7 +1874,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
sc->empty_duration = av_rescale(sc->empty_duration, sc->time_scale, mov->time_scale);
sc->time_offset = sc->start_time - sc->empty_duration;
current_dts = -sc->time_offset;
if (sc->ctts_data && sc->stts_data &&
if (sc->ctts_count>0 && sc->stts_count>0 &&
sc->ctts_data[0].duration / FFMAX(sc->stts_data[0].duration, 1) > 16) {
/* more than 16 frames delay, dts are likely wrong
this happens with files created by iMovie */

View File

@@ -530,6 +530,9 @@ static int ogg_get_length(AVFormatContext *s)
s->streams[i]->duration -= pts;
ogg->streams[i].got_start= 1;
streams_left--;
}else if(s->streams[i]->start_time != AV_NOPTS_VALUE && !ogg->streams[i].got_start){
ogg->streams[i].got_start= 1;
streams_left--;
}
if(streams_left<=0)
break;

View File

@@ -203,12 +203,12 @@ vorbis_header (AVFormatContext * s, int idx)
int pkt_type = os->buf[os->pstart];
if (!(pkt_type & 1))
return 0;
return os->private ? 0 : -1;
if (!os->private) {
os->private = av_mallocz(sizeof(struct oggvorbis_private));
if (!os->private)
return 0;
return -1;
}
if (os->psize < 1 || pkt_type > 5)

View File

@@ -652,10 +652,11 @@ enum CodecID ff_wav_codec_get_id(unsigned int tag, int bps)
return id;
}
int ff_get_bmp_header(AVIOContext *pb, AVStream *st)
int ff_get_bmp_header(AVIOContext *pb, AVStream *st, unsigned *esize)
{
int tag1;
avio_rl32(pb); /* size */
if(esize) *esize = avio_rl32(pb);
else avio_rl32(pb);
st->codec->width = avio_rl32(pb);
st->codec->height = (int32_t)avio_rl32(pb);
avio_rl16(pb); /* planes */

View File

@@ -44,7 +44,7 @@ void ff_end_tag(AVIOContext *pb, int64_t start);
* bits_per_encoded_sample fields. Does not read extradata.
* @return codec tag
*/
int ff_get_bmp_header(AVIOContext *pb, AVStream *st);
int ff_get_bmp_header(AVIOContext *pb, AVStream *st, unsigned *esize);
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc);

View File

@@ -1207,6 +1207,9 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
st->parser->pict_type == AV_PICTURE_TYPE_I))
out_pkt.flags |= AV_PKT_FLAG_KEY;
if(st->parser->key_frame == -1 && st->parser->pict_type==AV_PICTURE_TYPE_NONE && (pkt->flags&AV_PKT_FLAG_KEY))
out_pkt.flags |= AV_PKT_FLAG_KEY;
compute_pkt_fields(s, st, st->parser, &out_pkt);
if ((s->iformat->flags & AVFMT_GENERIC_INDEX) &&

View File

@@ -522,7 +522,7 @@ static int parse_videoinfoheader2(AVFormatContext *s, AVStream *st)
AVIOContext *pb = wtv->pb;
avio_skip(pb, 72); // picture aspect ratio is unreliable
ff_get_bmp_header(pb, st);
ff_get_bmp_header(pb, st, NULL);
return 72 + 40;
}

View File

@@ -7,4 +7,4 @@ HEADERS = swresample.h
OBJS = swresample.o audioconvert.o resample.o rematrix.o dither.o
TESTPROGS = swresample_test
TESTPROGS = swresample

View File

@@ -243,7 +243,7 @@ int main(int argc, char **argv){
struct SwrContext *backw_ctx= NULL;
if (argc > 1) {
if (!strcmp(argv[1], "-h")) {
if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
av_log(NULL, AV_LOG_INFO, "Usage: swresample-test [<num_tests>[ <test>]] \n"
"num_tests Default is %d\n", num_tests);
return 0;

View File

@@ -629,6 +629,7 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun
av_freep(&tmp.data);
if(s->drop_output || !out_arg)
return 0;
in_count = 0;
}
if(!in_arg){

View File

@@ -351,7 +351,7 @@ do_video_decoding "" "-sws_flags neighbor+bitexact -pix_fmt yuv420p"
fi
if [ -n "$do_avui" ] ; then
do_video_encoding avui.mov "-s pal -an -c:v avui -sws_flags neighbor+bitexact"
do_video_encoding avui.mov "-s pal -an -c:v avui -strict experimental -sws_flags neighbor+bitexact"
do_video_decoding "" "-s cif -sws_flags neighbor+bitexact -pix_fmt yuv420p"
fi

View File

@@ -97,7 +97,7 @@ fate-dxa-scummvm: CMD = framecrc -i $(SAMPLES)/dxa/scummvm.dxa -pix_fmt rgb24
FATE_VIDEO += $(FATE_DXA)
fate-dxa: $(FATE_DXA)
FATE_PCM += fate-film-cvid
FATE_SAMPLES_PCM += fate-film-cvid
fate-film-cvid: CMD = framecrc -i $(SAMPLES)/film/logo-capcom.cpk -an
FATE_FLIC += fate-flic-af11-palette-change

View File

@@ -49,12 +49,19 @@ static void probe(AVProbeData *pd, int type, int p, int size)
}
}
int main(void)
int main(int argc, char **argv)
{
unsigned int p, i, type, size, retry;
AVProbeData pd;
AVLFG state;
PutBitContext pb;
int retry_count= 4097;
int max_size = 65537;
if(argc >= 2)
retry_count = atoi(argv[1]);
if(argc >= 3)
max_size = atoi(argv[2]);
avcodec_register_all();
av_register_all();
@@ -62,14 +69,14 @@ int main(void)
av_lfg_init(&state, 0xdeadbeef);
pd.buf = NULL;
for (size = 1; size < 65537; size *= 2) {
for (size = 1; size < max_size; size *= 2) {
pd.buf_size = size;
pd.buf = av_realloc(pd.buf, size + AVPROBE_PADDING_SIZE);
pd.filename = "";
fprintf(stderr, "testing size=%d\n", size);
for (retry = 0; retry < 4097; retry += FFMAX(size, 32)) {
for (retry = 0; retry < retry_count; retry += FFMAX(size, 32)) {
for (type = 0; type < 4; type++) {
for (p = 0; p < 4096; p++) {
unsigned hist = 0;