Compare commits

..

44 Commits

Author SHA1 Message Date
Michael Niedermayer
e0465d6fcf Update for 1.2.9
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-07 19:40:13 +02:00
Michael Niedermayer
65889b62b3 swresample/swresample: fix sample drop loop end condition
Fixes Ticket3985

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-06 01:31:39 +02:00
Michael Niedermayer
7fc97160c2 avcodec/h264: Check mode before considering mixed mode intra prediction
Fixes out of array read
Fixes: asan_heap-oob_e476fc_2_asan_heap-oob_1333ec6_61_CAMACI3_Sony_C.jsv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-04 15:04:43 +02:00
Michael Niedermayer
c4f0f3c52d avformat/mpegts: Check desc_len / get8() return code
Fixes out of array read
Fixes: signal_sigsegv_844d59_10_signal_sigsegv_a17bb7_366_mpegts_mpeg2video_mp2_dvbsub_topfield.rec

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-04 05:30:22 +02:00
Michael Niedermayer
4865948d2e avcodec/smc: fix off by 1 error
Fixes out of array access
Fixes: asan_heap-oob_1685bf0_5_asan_heap-oob_1f35116_430_smc.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-03 23:24:27 +02:00
Michael Niedermayer
891376d261 avcodec/qpeg: fix off by 1 error in MV bounds check
Fixes out of array access
Fixes: asan_heap-oob_153760f_4_asan_heap-oob_1d7a4cf_164_VWbig6.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-03 21:32:15 +02:00
Michael Niedermayer
24a5cd720d avcodec/gifdec: factorize interleave end handling out
also change it to a loop
Fixes out of array access
Fixes: asan_heap-oob_ca5410_8_asan_heap-oob_ca5410_97_ID_LSD_Size_Less_Then_Data_Inter_3.gif

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-03 20:28:52 +02:00
Michael Niedermayer
75f5fe165c avcodec/cinepak: fix integer underflow
Fixes out of array access
Fixes: asan_heap-oob_4da0ba_6_asan_heap-oob_4da0ba_241_cvid_crash.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-03 19:47:43 +02:00
Michael Niedermayer
665f70209a avcodec/pngdec: Calculate MPNG bytewidth more defensively
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e830902934)

Conflicts:

	libavcodec/pngdec.c
2014-10-03 18:36:41 +02:00
Michael Niedermayer
12c8e4021c avcodec/pngdec: Check bits per pixel before setting monoblack pixel format
Fixes out of array accesses
Fixes: asan_heap-oob_14dbfcf_4_asan_heap-oob_1ce5767_179_add_method_small.png

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-03 18:35:38 +02:00
Michael Niedermayer
f56095c4d7 avcodec/tiff: more completely check bpp/bppcount
Fixes pixel format selection
Fixes out of array accesses
Fixes: asan_heap-oob_1766029_6_asan_heap-oob_20aa045_332_cov_1823216757_m2-d1d366d7965db766c19a66c7a2ccbb6b.tif

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-03 16:48:23 +02:00
Michael Niedermayer
76601e4ab8 avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
Fixes out of array access
Fixes: asan_heap-oob_4da4f3_8_asan_heap-oob_4da4f3_419_scene1a.mm

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

Conflicts:

	libavcodec/mmvideo.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-03 15:12:37 +02:00
Michael Niedermayer
e90d620cb9 avcodec/utils: Add case for jv to avcodec_align_dimensions2()
Fixes out of array accesses
Fixes: asan_heap-oob_12304aa_8_asan_heap-oob_4da4f3_300_intro.jv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-03 05:07:33 +02:00
Michael Niedermayer
0ffa44340f avcodec/mjpegdec: check bits per pixel for changes similar to dimensions
Fixes out of array accesses
Fixes: asan_heap-oob_16668e9_2_asan_heap-oob_16668e9_346_miss_congeniality_pegasus_mjpg.avi

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

Conflicts:

	libavcodec/mjpegdec.c
(cherry picked from commit 94371a404c663c3dae3d542fa43951567ab67f82)

Conflicts:

	libavcodec/mjpegdec.c
2014-10-03 02:30:00 +02:00
Michael Niedermayer
0bd9b78fb6 avcodec/jpeglsdec: Check run value more completely in ls_decode_line()
previously it could have been by 1 too large
Fixes out of array access
Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8c1e3.jls
Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8nde0.jls
Fixes: asan_heap-oob_12240fa_1_asan_heap-oob_12240fa_448_t16e3.jls

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-03 02:29:04 +02:00
Reimar Döffinger
997bf49b1c configure: add noexecstack to linker options if supported.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit b7082d953f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-28 12:11:22 +02:00
Michael Niedermayer
e9d85860d0 avcodec/ac3enc_template: fix out of array read
Found-by: Andreas Cadhalpun
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d85ebea3f3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-27 20:58:44 +02:00
lvqcl
2144ce08c1 avutil/x86/cpu: fix cpuid sub-leaf selection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e58fc44649)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-27 13:58:59 +02:00
Gianluigi Tiesi
e28c27e25f avcodec/libilbc: support for latest git of libilbc
in the latest git commits of libilbc developers removed WebRtc_xxx typedefs

This commit uses int types instead,
it's safe to apply also for previous versions since
WebRtc_Word16 was always a typedef of int16_t and
WebRtc_UWord16 a typedef of uint16_t

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 59af5383c1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-21 17:04:19 +02:00
James Almer
9b9048a3dd x86/dsputil: add emms to ff_scalarproduct_int16_mmxext()
Also undo the changes to ra144enc.c from previous commits.
Should fix ticket #3429

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9e0e1f9067)

Conflicts:

	libavcodec/ra144enc.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:14:30 +02:00
Katerina Barone-Adesi
70dc7bb893 apetag: Fix APE tag size check
The size variable is (correctly) unsigned, but is passed to several functions
which take signed parameters, such as avio_read, sometimes after having
numbers added to it. So ensure that size remains within the bounds that
these functions can handle.

CC: libav-stable@libav.org
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit c5560e72d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-17 21:38:31 +02:00
Michael Niedermayer
b9b97900c1 avformat/m4vdec: Check for non startcode 00 00 00 sequences in probe
Fixes miss detection of PCM as m4v
Fixes Ticket 3928

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 17:11:03 +02:00
Michael Niedermayer
d49b57fe0f avcodec/mpegvideo: Set err on failure in ff_mpv_common_frame_size_change()
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cfce6f7efd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 15:33:07 +02:00
Michael Niedermayer
0f1882b9b2 avcodec/mpegvideo: check that the context is initialized in ff_mpv_common_frame_size_change()
The function otherwise would initialize the context without setting context_initialized
alternatively we could set context_initialized

Fixes valgrind anomalies related to ticket 3928

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 15:33:06 +02:00
Michael Niedermayer
0fc229450f avcodec/mpegvideo: Use "goto fail" for all error paths in ff_mpv_common_frame_size_change()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2762323c37)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 15:33:05 +02:00
Michael Niedermayer
6f02de4ee8 avformat/swfdec: Do not change the pixel format
This is currently not supported
Fixes part of Ticket 3539

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 13:41:13 +02:00
Michael Niedermayer
248a2fca90 avformat/swfdec: Use side data to communicate w/h changes to the decoder
Fixes reading from freed data
Fixes part of Ticket3539

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c55d0ff32)

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 13:41:13 +02:00
Michael Niedermayer
1482253790 avcodec/snow: check coeffs for validity
Fixes deadlock
Fixes integer overflow
Fixes Ticket 3892

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 13:41:13 +02:00
Timothy Gu
0f578ea705 bktr: Fix Fabrice's name
Signed-off-by: Timothy Gu <timothygu99@gmail.com>

This file with the incorrect name was added after the name was fixed in all other files.
This is thus fixing a mistake

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 13:41:13 +02:00
Michael Niedermayer
48443598ed avcodec/utils: add GBRP16 to avcodec_align_dimensions2()
Fixes Ticket3869

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 13:41:13 +02:00
Michael Niedermayer
30ffb80dca avcodec: fix aac/ac3 parser bitstream buffer size
Buffers containing copies of the AAC and AC3 header bits were not padded
before parsing, violating init_get_bits() buffer padding requirement,
leading to potential buffer read overflows.
This change adds FF_INPUT_BUFFER_PADDING_SIZE bytes to the bit buffer
for parsing the header in each of aac_parser.c and ac3_parser.c.

Based on patch by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fccd85b9f3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-07 13:41:13 +02:00
Michael Niedermayer
0a64e9a029 version.sh: Print versions based on the last git tag for release branches
release branches are detected by checking if "git" is not in RELEASE
This changes "N-64706-g2f71aeb" to "n2.3-8-g2f71aeb"
for git master theres no change

This should improve the readability of lists of versions which come from
more than 1 release branch or master + release. fate.ffmpeg.org is
one possible example

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ee606fd031)

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-19 03:16:20 +02:00
Michael Niedermayer
59b2a9ef95 remove VERSION file
it overrides what version.sh prints and thus makes its output
from release branches rather useless

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

Conflicts:

	VERSION
(cherry picked from commit f543d32455)

Conflicts:

	VERSION
2014-08-19 03:16:11 +02:00
Michael Niedermayer
4ce6d65b6f Changelog: update for 1.2.8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-19 02:13:02 +02:00
Michael Niedermayer
ab4e54f6f6 update for 1.2.8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-17 17:31:13 +02:00
Christophe Gisquet
18342848f7 proresenc_kostya: report buffer overflow
If the allocated size, despite best efforts, is too small, exit
with the appropriate error.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-17 16:49:56 +02:00
Luca Barbato
61a51598e3 lavc: move put_bits_left in put_bits.h
(cherry picked from commit afe03092dd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-17 16:49:56 +02:00
Michael Niedermayer
abc1fa7c5a avcodec/iff: check pixfmt for rgb8 / rgbn
Fixes out of array access

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

Conflicts:

	libavcodec/iff.c
(cherry picked from commit 656f930160)

Conflicts:

	libavcodec/iff.c
2014-08-10 22:31:02 +02:00
Anton Khirnov
f712d3669e cdgraphics: do not return 0 from the decode function
0 means no data consumed, so it can trigger an infinite loop in the
caller.

CC:libav-stable@libav.org
(cherry picked from commit c7d9b473e2)

Conflicts:

	libavcodec/cdgraphics.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 02:05:19 +02:00
Michael Niedermayer
ca232ff9b0 avformat/tee: flip assigment direction
Found-by: CSA
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2e6fdcb7f3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 03:18:15 +02:00
Michael Niedermayer
b4632cec74 avcodec/dvdsub_parser: print message if packet is smaller than the packet size field
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bcc898dd26)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-02 01:27:37 +02:00
Michael Niedermayer
454f6c622c avcodec/dvdsub_parser: Check buf_size before reading 32bit packet size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81c1657a59)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-02 01:27:36 +02:00
Michael Niedermayer
f70ee7d14f avcodec/dvdsub_parser: never return 0 when the input isnt 0
Fixes a infinite loop
Fixes Ticket3804

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-02 01:27:34 +02:00
Michael Niedermayer
c285db74f6 avformat/utils: do not wait for packets from discarded streams for genpts
Fixes long loop
Fixes Ticket3208

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-13 01:15:57 +02:00
40 changed files with 144 additions and 75 deletions

View File

@@ -1,6 +1,14 @@
Entries are sorted chronologically from oldest to youngest within each release, Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest. releases are sorted from youngest to oldest.
version 1.2.8:
- proresenc_ks: fix buffer overflow
- iff: fix crash
- cdgraphics: fix infinite loop
- Fix Ticket3804
- Fix Ticket3208
version 1.2: version 1.2:
- VDPAU hardware acceleration through normal hwaccel - VDPAU hardware acceleration through normal hwaccel

View File

@@ -1 +1 @@
1.2.7 1.2.9

View File

@@ -1 +0,0 @@
1.2.7

1
configure vendored
View File

@@ -3750,6 +3750,7 @@ EOF
fi fi
check_ldflags -Wl,--as-needed check_ldflags -Wl,--as-needed
check_ldflags -Wl,-z,noexecstack
if check_func dlopen; then if check_func dlopen; then
ldl= ldl=

View File

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

View File

@@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int size; int size;
union { union {
uint64_t u64; uint64_t u64;
uint8_t u8[8]; uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
} tmp; } tmp;
tmp.u64 = av_be2ne64(state); tmp.u64 = av_be2ne64(state);

View File

@@ -147,7 +147,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int err; int err;
union { union {
uint64_t u64; uint64_t u64;
uint8_t u8[8]; uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
} tmp = { av_be2ne64(state) }; } tmp = { av_be2ne64(state) };
AC3HeaderInfo hdr; AC3HeaderInfo hdr;
GetBitContext gbc; GetBitContext gbc;

View File

@@ -260,7 +260,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
energy_cpl = energy[blk][CPL_CH][bnd]; energy_cpl = energy[blk][CPL_CH][bnd];
energy_ch = energy[blk][ch][bnd]; energy_ch = energy[blk][ch][bnd];
blk1 = blk+1; blk1 = blk+1;
while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) { while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
if (s->blocks[blk1].cpl_in_use) { if (s->blocks[blk1].cpl_in_use) {
energy_cpl += energy[blk1][CPL_CH][bnd]; energy_cpl += energy[blk1][CPL_CH][bnd];
energy_ch += energy[blk1][ch][bnd]; energy_ch += energy[blk1][ch][bnd];

View File

@@ -361,11 +361,10 @@ static int cdg_decode_frame(AVCodecContext *avctx,
*got_frame = 1; *got_frame = 1;
} else { } else {
*got_frame = 0; *got_frame = 0;
buf_size = 0;
} }
*(AVFrame *) data = cc->frame; *(AVFrame *) data = cc->frame;
return buf_size; return avpkt->size;
} }
static av_cold int cdg_decode_end(AVCodecContext *avctx) static av_cold int cdg_decode_end(AVCodecContext *avctx)

View File

@@ -134,7 +134,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip *strip,
const uint8_t *eod = (data + size); const uint8_t *eod = (data + size);
uint32_t flag, mask; uint32_t flag, mask;
uint8_t *cb0, *cb1, *cb2, *cb3; uint8_t *cb0, *cb1, *cb2, *cb3;
unsigned int x, y; int x, y;
char *ip0, *ip1, *ip2, *ip3; char *ip0, *ip1, *ip2, *ip3;
flag = 0; flag = 0;

View File

@@ -350,11 +350,6 @@ static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5; static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5;
static const int mb_area_start[5] = { 1, 6, 21, 43, 64 }; static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
static inline int put_bits_left(PutBitContext* s)
{
return (s->buf_end - s->buf) * 8 - put_bits_count(s);
}
#if CONFIG_SMALL #if CONFIG_SMALL
/* Converts run and level (where level != 0) pair into VLC, returning bit size */ /* Converts run and level (where level != 0) pair into VLC, returning bit size */
static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc) static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc)

View File

@@ -45,8 +45,11 @@ static int dvdsub_parse(AVCodecParserContext *s,
DVDSubParseContext *pc = s->priv_data; DVDSubParseContext *pc = s->priv_data;
if (pc->packet_index == 0) { if (pc->packet_index == 0) {
if (buf_size < 2) if (buf_size < 2 || AV_RB16(buf) && buf_size < 6) {
return 0; if (buf_size)
av_log(avctx, AV_LOG_DEBUG, "Parser input %d too small\n", buf_size);
return buf_size;
}
pc->packet_len = AV_RB16(buf); pc->packet_len = AV_RB16(buf);
if (pc->packet_len == 0) /* HD-DVD subpicture packet */ if (pc->packet_len == 0) /* HD-DVD subpicture packet */
pc->packet_len = AV_RB32(buf+2); pc->packet_len = AV_RB32(buf+2);

View File

@@ -253,26 +253,21 @@ static int gif_read_image(GifState *s)
case 1: case 1:
y1 += 8; y1 += 8;
ptr += linesize * 8; ptr += linesize * 8;
if (y1 >= height) {
y1 = pass ? 2 : 4;
ptr = ptr1 + linesize * y1;
pass++;
}
break; break;
case 2: case 2:
y1 += 4; y1 += 4;
ptr += linesize * 4; ptr += linesize * 4;
if (y1 >= height) {
y1 = 1;
ptr = ptr1 + linesize;
pass++;
}
break; break;
case 3: case 3:
y1 += 2; y1 += 2;
ptr += linesize * 2; ptr += linesize * 2;
break; break;
} }
while (y1 >= height) {
y1 = 4 >> pass;
ptr = ptr1 + linesize * y1;
pass++;
}
} else { } else {
ptr += linesize; ptr += linesize;
} }

View File

@@ -417,18 +417,18 @@ int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma)
if ((h->left_samples_available & 0x8080) != 0x8080) { if ((h->left_samples_available & 0x8080) != 0x8080) {
mode = left[mode]; mode = left[mode];
if (is_chroma && (h->left_samples_available & 0x8080)) {
// mad cow disease mode, aka MBAFF + constrained_intra_pred
mode = ALZHEIMER_DC_L0T_PRED8x8 +
(!(h->left_samples_available & 0x8000)) +
2 * (mode == DC_128_PRED8x8);
}
if (mode < 0) { if (mode < 0) {
av_log(h->avctx, AV_LOG_ERROR, av_log(h->avctx, AV_LOG_ERROR,
"left block unavailable for requested intra mode at %d %d\n", "left block unavailable for requested intra mode at %d %d\n",
h->mb_x, h->mb_y); h->mb_x, h->mb_y);
return -1; return -1;
} }
if (is_chroma && (h->left_samples_available & 0x8080)) {
// mad cow disease mode, aka MBAFF + constrained_intra_pred
mode = ALZHEIMER_DC_L0T_PRED8x8 +
(!(h->left_samples_available & 0x8000)) +
2 * (mode == DC_128_PRED8x8);
}
} }
return mode; return mode;

View File

@@ -832,9 +832,9 @@ static int decode_frame(AVCodecContext *avctx,
break; break;
case 4: case 4:
bytestream2_init(&gb, buf, buf_size); bytestream2_init(&gb, buf, buf_size);
if (avctx->codec_tag == MKTAG('R','G','B','8')) if (avctx->codec_tag == MKTAG('R','G','B','8') && avctx->pix_fmt == AV_PIX_FMT_RGB32)
decode_rgb8(&gb, s->frame.data[0], avctx->width, avctx->height, s->frame.linesize[0]); decode_rgb8(&gb, s->frame.data[0], avctx->width, avctx->height, s->frame.linesize[0]);
else if (avctx->codec_tag == MKTAG('R','G','B','N')) else if (avctx->codec_tag == MKTAG('R','G','B','N') && avctx->pix_fmt == AV_PIX_FMT_RGB444)
decode_rgbn(&gb, s->frame.data[0], avctx->width, avctx->height, s->frame.linesize[0]); decode_rgbn(&gb, s->frame.data[0], avctx->width, avctx->height, s->frame.linesize[0]);
else else
return unsupported(avctx); return unsupported(avctx);

View File

@@ -207,6 +207,11 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
x += stride; x += stride;
} }
if (x >= w) {
av_log(NULL, AV_LOG_ERROR, "run overflow\n");
return;
}
/* decode run termination value */ /* decode run termination value */
Rb = R(last, x); Rb = R(last, x);
RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0; RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;

View File

@@ -98,8 +98,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
return ret; return ret;
} }
WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0], WebRtcIlbcfix_DecodeImpl((int16_t *) frame->data[0], (const uint16_t *) buf, &s->decoder, 1);
(const WebRtc_UWord16*) buf, &s->decoder, 1);
*got_frame_ptr = 1; *got_frame_ptr = 1;
@@ -185,7 +184,7 @@ static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0) if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0)
return ret; return ret;
WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt->data, (const WebRtc_Word16*) frame->data[0], &s->encoder); WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt->data, (const int16_t *) frame->data[0], &s->encoder);
avpkt->size = s->encoder.no_of_bytes; avpkt->size = s->encoder.no_of_bytes;
*got_packet_ptr = 1; *got_packet_ptr = 1;

View File

@@ -211,7 +211,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
int ff_mjpeg_decode_sof(MJpegDecodeContext *s) int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
{ {
int len, nb_components, i, width, height, pix_fmt_id; int len, nb_components, i, width, height, bits, pix_fmt_id;
int h_count[MAX_COMPONENTS]; int h_count[MAX_COMPONENTS];
int v_count[MAX_COMPONENTS]; int v_count[MAX_COMPONENTS];
@@ -220,14 +220,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
/* XXX: verify len field validity */ /* XXX: verify len field validity */
len = get_bits(&s->gb, 16); len = get_bits(&s->gb, 16);
s->bits = get_bits(&s->gb, 8); bits = get_bits(&s->gb, 8);
if (s->pegasus_rct) if (s->pegasus_rct)
s->bits = 9; bits = 9;
if (s->bits == 9 && !s->pegasus_rct) if (bits == 9 && !s->pegasus_rct)
s->rct = 1; // FIXME ugly s->rct = 1; // FIXME ugly
if (s->bits != 8 && !s->lossless) { if (bits != 8 && !s->lossless) {
av_log(s->avctx, AV_LOG_ERROR, "only 8 bits/component accepted\n"); av_log(s->avctx, AV_LOG_ERROR, "only 8 bits/component accepted\n");
return -1; return -1;
} }
@@ -258,7 +258,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
} }
if (s->ls && !(s->bits <= 8 || nb_components == 1)) { if (s->ls && !(bits <= 8 || nb_components == 1)) {
av_log_missing_feature(s->avctx, av_log_missing_feature(s->avctx,
"For JPEG-LS anything except <= 8 bits/component" "For JPEG-LS anything except <= 8 bits/component"
" or 16-bit gray", 0); " or 16-bit gray", 0);
@@ -301,12 +301,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
/* if different size, realloc/alloc picture */ /* if different size, realloc/alloc picture */
if ( width != s->width || height != s->height if ( width != s->width || height != s->height
|| bits != s->bits
|| memcmp(s->h_count, h_count, sizeof(h_count)) || memcmp(s->h_count, h_count, sizeof(h_count))
|| memcmp(s->v_count, v_count, sizeof(v_count))) { || memcmp(s->v_count, v_count, sizeof(v_count))) {
av_freep(&s->qscale_table); av_freep(&s->qscale_table);
s->width = width; s->width = width;
s->height = height; s->height = height;
s->bits = bits;
memcpy(s->h_count, h_count, sizeof(h_count)); memcpy(s->h_count, h_count, sizeof(h_count));
memcpy(s->v_count, v_count, sizeof(v_count)); memcpy(s->v_count, v_count, sizeof(v_count));
s->interlaced = 0; s->interlaced = 0;

View File

@@ -109,7 +109,7 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
if (color) { if (color) {
memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length); memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
if (half_vert) if (half_vert && y + half_vert < s->avctx->height)
memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length); memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
} }
x+= run_length; x+= run_length;

View File

@@ -1086,6 +1086,9 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
{ {
int i, err = 0; int i, err = 0;
if (!s->context_initialized)
return AVERROR(EINVAL);
if (s->slice_context_count > 1) { if (s->slice_context_count > 1) {
for (i = 0; i < s->slice_context_count; i++) { for (i = 0; i < s->slice_context_count; i++) {
free_duplicate_context(s->thread_context[i]); free_duplicate_context(s->thread_context[i]);
@@ -1114,8 +1117,8 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
s->mb_height = (s->height + 15) / 16; s->mb_height = (s->height + 15) / 16;
if ((s->width || s->height) && if ((s->width || s->height) &&
av_image_check_size(s->width, s->height, 0, s->avctx)) (err = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0)
return AVERROR_INVALIDDATA; goto fail;
if ((err = init_context_frame(s))) if ((err = init_context_frame(s)))
goto fail; goto fail;
@@ -1131,7 +1134,7 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
} }
for (i = 0; i < nb_slices; i++) { for (i = 0; i < nb_slices; i++) {
if (init_duplicate_context(s->thread_context[i]) < 0) if ((err = init_duplicate_context(s->thread_context[i])) < 0)
goto fail; goto fail;
s->thread_context[i]->start_mb_y = s->thread_context[i]->start_mb_y =
(s->mb_height * (i) + nb_slices / 2) / nb_slices; (s->mb_height * (i) + nb_slices / 2) / nb_slices;

View File

@@ -631,7 +631,7 @@ static int decode_frame(AVCodecContext *avctx,
} else if ((s->bits_per_pixel == 1 || s->bits_per_pixel == 2 || s->bits_per_pixel == 4 || s->bits_per_pixel == 8) && } else if ((s->bits_per_pixel == 1 || s->bits_per_pixel == 2 || s->bits_per_pixel == 4 || s->bits_per_pixel == 8) &&
s->color_type == PNG_COLOR_TYPE_PALETTE) { s->color_type == PNG_COLOR_TYPE_PALETTE) {
avctx->pix_fmt = AV_PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
} else if (s->bit_depth == 1) { } else if (s->bit_depth == 1 && s->bits_per_pixel == 1) {
avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
} else if (s->bit_depth == 8 && } else if (s->bit_depth == 8 &&
s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
@@ -842,9 +842,10 @@ static int decode_frame(AVCodecContext *avctx,
int i, j; int i, j;
uint8_t *pd = s->current_picture->data[0]; uint8_t *pd = s->current_picture->data[0];
uint8_t *pd_last = s->last_picture->data[0]; uint8_t *pd_last = s->last_picture->data[0];
int ls = FFMIN(av_image_get_linesize(s->current_picture->format, s->width, 0), s->width * s->bpp);
for (j = 0; j < s->height; j++) { for (j = 0; j < s->height; j++) {
for (i = 0; i < s->width * s->bpp; i++) { for (i = 0; i < ls; i++) {
pd[i] += pd_last[i]; pd[i] += pd_last[i];
} }
pd += s->image_linesize; pd += s->image_linesize;

View File

@@ -456,6 +456,11 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
num_cblocks, plane_factor, num_cblocks, plane_factor,
qmat); qmat);
total_size += sizes[i]; total_size += sizes[i];
if (put_bits_left(pb) < 0) {
av_log(avctx, AV_LOG_ERROR, "Serious underevaluation of"
"required buffer size");
return AVERROR_BUFFER_TOO_SMALL;
}
} }
return total_size; return total_size;
} }
@@ -754,9 +759,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1; avctx->coded_frame->key_frame = 1;
pkt_size = ctx->frame_size_upper_bound + FF_MIN_BUFFER_SIZE; pkt_size = ctx->frame_size_upper_bound;
if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0) if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size + FF_MIN_BUFFER_SIZE)) < 0)
return ret; return ret;
orig_buf = pkt->data; orig_buf = pkt->data;
@@ -833,7 +838,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
slice_hdr = buf; slice_hdr = buf;
buf += slice_hdr_size - 1; buf += slice_hdr_size - 1;
init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8); init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8);
encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice); ret = encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice);
if (ret < 0)
return ret;
bytestream_put_byte(&slice_hdr, q); bytestream_put_byte(&slice_hdr, q);
slice_size = slice_hdr_size + sizes[ctx->num_planes - 1]; slice_size = slice_hdr_size + sizes[ctx->num_planes - 1];

View File

@@ -75,6 +75,14 @@ static inline int put_bits_count(PutBitContext *s)
return (s->buf_ptr - s->buf) * 8 + 32 - s->bit_left; return (s->buf_ptr - s->buf) * 8 + 32 - s->bit_left;
} }
/**
* @return the number of bits available in the bitstream.
*/
static inline int put_bits_left(PutBitContext* s)
{
return (s->buf_end - s->buf_ptr) * 8 - 32 + s->bit_left;
}
/** /**
* Pad the end of the output stream with zeros. * Pad the end of the output stream with zeros.
*/ */

View File

@@ -163,7 +163,7 @@ static void qpeg_decode_inter(QpegContext *qctx, uint8_t *dst,
/* check motion vector */ /* check motion vector */
if ((me_x + filled < 0) || (me_x + me_w + filled > width) || if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
(height - me_y - me_h < 0) || (height - me_y > orig_height) || (height - me_y - me_h < 0) || (height - me_y >= orig_height) ||
(filled + me_w > width) || (height - me_h < 0)) (filled + me_w > width) || (height - me_h < 0))
av_log(NULL, AV_LOG_ERROR, "Bogus motion vector (%i,%i), block size %ix%i at %i,%i\n", av_log(NULL, AV_LOG_ERROR, "Bogus motion vector (%i,%i), block size %ix%i at %i,%i\n",
me_x, me_y, me_w, me_h, filled, height); me_x, me_y, me_w, me_h, filled, height);

View File

@@ -34,7 +34,6 @@
#include "celp_filters.h" #include "celp_filters.h"
#include "ra144.h" #include "ra144.h"
static av_cold int ra144_encode_close(AVCodecContext *avctx) static av_cold int ra144_encode_close(AVCodecContext *avctx)
{ {
RA144Context *ractx = avctx->priv_data; RA144Context *ractx = avctx->priv_data;

View File

@@ -69,7 +69,7 @@ typedef struct SmcContext {
row_ptr += stride * 4; \ row_ptr += stride * 4; \
} \ } \
total_blocks--; \ total_blocks--; \
if (total_blocks < 0) \ if (total_blocks < 0 + !!n_blocks) \
{ \ { \
av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \ av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
return; \ return; \

View File

@@ -652,7 +652,10 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
if(v){ if(v){
v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1); v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1);
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]); v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]);
if ((uint16_t)v != v) {
av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n");
v = 1;
}
xc->x=x; xc->x=x;
(xc++)->coeff= v; (xc++)->coeff= v;
} }
@@ -662,6 +665,10 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
else run= INT_MAX; else run= INT_MAX;
v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1); v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1);
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]); v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]);
if ((uint16_t)v != v) {
av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n");
v = 1;
}
xc->x=x; xc->x=x;
(xc++)->coeff= v; (xc++)->coeff= v;

View File

@@ -716,13 +716,13 @@ static int tiff_decode_tag(TiffContext *s)
s->height = value; s->height = value;
break; break;
case TIFF_BPP: case TIFF_BPP:
s->bppcount = count; if (count > 4U) {
if (count > 4) {
av_log(s->avctx, AV_LOG_ERROR, av_log(s->avctx, AV_LOG_ERROR,
"This format is not supported (bpp=%d, %d components)\n", "This format is not supported (bpp=%d, %d components)\n",
s->bpp, count); value, count);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
s->bppcount = count;
if (count == 1) if (count == 1)
s->bpp = value; s->bpp = value;
else { else {
@@ -743,6 +743,13 @@ static int tiff_decode_tag(TiffContext *s)
s->bpp = -1; s->bpp = -1;
} }
} }
if (s->bpp > 64U) {
av_log(s->avctx, AV_LOG_ERROR,
"This format is not supported (bpp=%d, %d components)\n",
s->bpp, count);
s->bpp = 0;
return AVERROR_INVALIDDATA;
}
break; break;
case TIFF_SAMPLES_PER_PIXEL: case TIFF_SAMPLES_PER_PIXEL:
if (count != 1) { if (count != 1) {

View File

@@ -244,6 +244,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
case AV_PIX_FMT_GBRP12BE: case AV_PIX_FMT_GBRP12BE:
case AV_PIX_FMT_GBRP14LE: case AV_PIX_FMT_GBRP14LE:
case AV_PIX_FMT_GBRP14BE: case AV_PIX_FMT_GBRP14BE:
case AV_PIX_FMT_GBRP16LE:
case AV_PIX_FMT_GBRP16BE:
w_align = 16; //FIXME assume 16 pixel per macroblock w_align = 16; //FIXME assume 16 pixel per macroblock
h_align = 16 * 2; // interlaced needs 2 macroblocks height h_align = 16 * 2; // interlaced needs 2 macroblocks height
break; break;
@@ -272,6 +274,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
w_align = 4; w_align = 4;
h_align = 4; h_align = 4;
} }
if (s->codec_id == AV_CODEC_ID_JV) {
w_align = 8;
h_align = 8;
}
break; break;
case AV_PIX_FMT_BGR24: case AV_PIX_FMT_BGR24:
if ((s->codec_id == AV_CODEC_ID_MSZH) || if ((s->codec_id == AV_CODEC_ID_MSZH) ||

View File

@@ -61,6 +61,9 @@ cglobal scalarproduct_int16, 3,3,3, v1, v2, order
%endif %endif
paddd m2, m0 paddd m2, m0
movd eax, m2 movd eax, m2
%if mmsize == 8
emms
%endif
RET RET
; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul) ; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)

View File

@@ -3,7 +3,7 @@
* Copyright (c) 2002 Steve O'Hara-Smith * Copyright (c) 2002 Steve O'Hara-Smith
* based on * based on
* Linux video grab interface * Linux video grab interface
* Copyright (c) 2000,2001 Gerard Lantau * Copyright (c) 2000, 2001 Fabrice Bellard
* and * and
* simple_grab.c Copyright (c) 1999 Roger Hardiman * simple_grab.c Copyright (c) 1999 Roger Hardiman
* *

View File

@@ -51,8 +51,10 @@ static int ape_tag_read_field(AVFormatContext *s)
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key); av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
return -1; return -1;
} }
if (size >= UINT_MAX) if (size > INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
return -1; av_log(s, AV_LOG_ERROR, "APE tag size too large.\n");
return AVERROR_INVALIDDATA;
}
if (flags & APE_TAG_FLAG_IS_BINARY) { if (flags & APE_TAG_FLAG_IS_BINARY) {
uint8_t filename[1024]; uint8_t filename[1024];
enum AVCodecID id; enum AVCodecID id;

View File

@@ -33,13 +33,15 @@ static int mpeg4video_probe(AVProbeData *probe_packet)
for(i=0; i<probe_packet->buf_size; i++){ for(i=0; i<probe_packet->buf_size; i++){
temp_buffer = (temp_buffer<<8) + probe_packet->buf[i]; temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
if ((temp_buffer & 0xffffff00) != 0x100) if (temp_buffer & 0xfffffe00)
continue;
if (temp_buffer < 2)
continue; continue;
if (temp_buffer == VOP_START_CODE) VOP++; if (temp_buffer == VOP_START_CODE) VOP++;
else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++; else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++;
else if (temp_buffer < 0x120) VO++; else if (temp_buffer >= 0x100 && temp_buffer < 0x120) VO++;
else if (temp_buffer < 0x130) VOL++; else if (temp_buffer >= 0x120 && temp_buffer < 0x130) VOL++;
else if ( !(0x1AF < temp_buffer && temp_buffer < 0x1B7) else if ( !(0x1AF < temp_buffer && temp_buffer < 0x1B7)
&& !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++; && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++;
} }

View File

@@ -1695,7 +1695,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
break; break;
desc_len = get8(&p, desc_list_end); desc_len = get8(&p, desc_list_end);
desc_end = p + desc_len; desc_end = p + desc_len;
if (desc_end > desc_list_end) if (desc_len < 0 || desc_end > desc_list_end)
break; break;
av_dlog(ts->stream, "tag: 0x%02x len=%d\n", av_dlog(ts->stream, "tag: 0x%02x len=%d\n",

View File

@@ -283,6 +283,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
const int bmp_fmt = avio_r8(pb); const int bmp_fmt = avio_r8(pb);
const int width = avio_rl16(pb); const int width = avio_rl16(pb);
const int height = avio_rl16(pb); const int height = avio_rl16(pb);
int pix_fmt;
len -= 2+1+2+2; len -= 2+1+2+2;
@@ -347,17 +348,21 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
avpriv_set_pts_info(vst, 64, 256, swf->frame_rate); avpriv_set_pts_info(vst, 64, 256, swf->frame_rate);
st = vst; st = vst;
} }
st->codec->width = width;
st->codec->height = height;
if ((res = av_new_packet(pkt, out_len - colormapsize * colormapbpp)) < 0) if ((res = av_new_packet(pkt, out_len - colormapsize * colormapbpp)) < 0)
goto bitmap_end; goto bitmap_end;
if (!st->codec->width && !st->codec->height) {
st->codec->width = width;
st->codec->height = height;
} else {
ff_add_param_change(pkt, 0, 0, 0, width, height);
}
pkt->pos = pos; pkt->pos = pos;
pkt->stream_index = st->index; pkt->stream_index = st->index;
switch (bmp_fmt) { switch (bmp_fmt) {
case 3: case 3:
st->codec->pix_fmt = AV_PIX_FMT_PAL8; pix_fmt = AV_PIX_FMT_PAL8;
for (i = 0; i < colormapsize; i++) for (i = 0; i < colormapsize; i++)
if (alpha_bmp) colormap[i] = buf[3]<<24 | AV_RB24(buf + 4*i); if (alpha_bmp) colormap[i] = buf[3]<<24 | AV_RB24(buf + 4*i);
else colormap[i] = 0xffU <<24 | AV_RB24(buf + 3*i); else colormap[i] = 0xffU <<24 | AV_RB24(buf + 3*i);
@@ -369,14 +374,20 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
memcpy(pal, colormap, AVPALETTE_SIZE); memcpy(pal, colormap, AVPALETTE_SIZE);
break; break;
case 4: case 4:
st->codec->pix_fmt = AV_PIX_FMT_RGB555; pix_fmt = AV_PIX_FMT_RGB555;
break; break;
case 5: case 5:
st->codec->pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB; pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB;
break; break;
default: default:
av_assert0(0); av_assert0(0);
} }
if (st->codec->pix_fmt != AV_PIX_FMT_NONE && st->codec->pix_fmt != pix_fmt) {
av_log(s, AV_LOG_ERROR, "pixel format change unsupported\n");
res = AVERROR_PATCHWELCOME;
goto bitmap_end;
}
st->codec->pix_fmt = pix_fmt;
if (linesize * height > pkt->size) { if (linesize * height > pkt->size) {
res = AVERROR_INVALIDDATA; res = AVERROR_INVALIDDATA;

View File

@@ -251,7 +251,7 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
if ((ret = av_copy_packet(&pkt2, pkt)) < 0 || if ((ret = av_copy_packet(&pkt2, pkt)) < 0 ||
(ret = av_dup_packet(&pkt2))< 0) (ret = av_dup_packet(&pkt2))< 0)
if (!ret_all) { if (!ret_all) {
ret = ret_all; ret_all = ret;
continue; continue;
} }
tb = avf ->streams[s]->time_base; tb = avf ->streams[s]->time_base;

View File

@@ -1533,7 +1533,8 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
} }
/* read packet from packet buffer, if there is data */ /* read packet from packet buffer, if there is data */
if (!(next_pkt->pts == AV_NOPTS_VALUE && st = s->streams[next_pkt->stream_index];
if (!(next_pkt->pts == AV_NOPTS_VALUE && st->discard < AVDISCARD_ALL &&
next_pkt->dts != AV_NOPTS_VALUE && !eof)) { next_pkt->dts != AV_NOPTS_VALUE && !eof)) {
ret = read_from_packet_buffer(&s->packet_buffer, ret = read_from_packet_buffer(&s->packet_buffer,
&s->packet_buffer_end, pkt); &s->packet_buffer_end, pkt);

View File

@@ -44,7 +44,7 @@
"cpuid \n\t" \ "cpuid \n\t" \
"xchg %%"REG_b", %%"REG_S \ "xchg %%"REG_b", %%"REG_S \
: "=a" (eax), "=S" (ebx), "=c" (ecx), "=d" (edx) \ : "=a" (eax), "=S" (ebx), "=c" (ecx), "=d" (edx) \
: "0" (index)) : "0" (index), "2"(0))
#define xgetbv(index, eax, edx) \ #define xgetbv(index, eax, edx) \
__asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index)) __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index))

View File

@@ -751,6 +751,8 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun
in_count = 0; in_count = 0;
if(ret>0) { if(ret>0) {
s->drop_output -= ret; s->drop_output -= ret;
if (!s->drop_output && !out_arg)
return 0;
continue; continue;
} }

View File

@@ -2,7 +2,11 @@
# check for git short hash # check for git short hash
if ! test "$revision"; then if ! test "$revision"; then
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null) if (cd "$1" && grep git RELEASE 2> /dev/null >/dev/null) ; then
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
else
revision=$(cd "$1" && git describe --tags --always 2> /dev/null)
fi
fi fi
# Shallow Git clones (--depth) do not have the N tag: # Shallow Git clones (--depth) do not have the N tag: