Compare commits

...

39 Commits

Author SHA1 Message Date
Michael Niedermayer
f166a02b67 exr: silence warning "libavcodec/exr.c:351:9: warning: variable ret set but not used"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7ff3bfd584)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:22:26 +02:00
Michael Niedermayer
c5948b472b update for 1.2.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:17:06 +02:00
Michael Niedermayer
7ee5e97c46 gifdec: reset previous Graphic Control Extension disposal type
This fixes out of array accesses.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:16:23 +02:00
Michael Niedermayer
7ef2dbd239 avcodec/cdgraphics: check buffer size before use
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:16:23 +02:00
Michael Niedermayer
524d0d2cfc sanm: Check dimensions before use
Fixes integer overflow and out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:16:23 +02:00
Clément Bœsch
91f04e7410 cmdutils: avtool -> fftool
(cherry picked from commit 7d8ad6c1fa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:16:23 +02:00
Michael Niedermayer
9f7baf139f avutil/intfloat_readwrite: include common.h for isinf()
Solution based on rational.c, which uses isinf() too

This should fix compilation with msvc

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:16:23 +02:00
Michael Niedermayer
ec89046fa1 avutil/intfloat_readwrite: avoid comparission with INFINITY, use isinf()
Should fix pgc warning

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:16:23 +02:00
Michael Niedermayer
cc0dd86580 avutil/log: Fix context pointer used for get_category()
Fixes calling a random pointer

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:02:15 +02:00
Michael Niedermayer
0baa0a5a02 vmdav: Try to fix unpack_rle()
This fixes out of array accesses
The code prior to this commit could not have worked, thus obviously
was untested. I was also not able to find a valid sample that uses this
code.
This fix is thus only based on the description of the format

If someone has a sample that uses unpack_rle(), please mail me.

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

Conflicts:

	libavcodec/vmdav.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 22:01:55 +02:00
Michael Niedermayer
039f6921c2 mmvideo/mm_decode_intra: check horizontal coordinate too
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae2132ac90)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 21:44:08 +02:00
Michael Niedermayer
7fa6db2545 mmvideo/mm_decode_inter: check horizontal coordinate too
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 21:44:03 +02:00
Michael Niedermayer
840931e766 mjpegdec: fix overlapping memcpy with upscale_v
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b39fd7d63648442c20671c3e4b357268ec5c49f2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 21:42:40 +02:00
Michael Niedermayer
1ce3f736d2 src_movie: fix scanf string
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 21:01:03 +02:00
Michael Niedermayer
4d0090f90a xbmdec: fix off by one error in scanf()
Fixes out of array access

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 21:01:02 +02:00
Dale Curtis
f8d5f3dff5 Fix heap-buffer-overflow in matroska_parse_block
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81e85bc95c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 21:01:02 +02:00
ArnoB
298e03d102 dpxenc: fix data offset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 361319d0f4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 21:01:02 +02:00
Michael Niedermayer
54f3902393 rmdec: flush audio packet on seeking
Fixes Ticket1605

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-09 21:01:02 +02:00
Michael Niedermayer
3ca6253beb avcodec/mpegvideo: Fix edge emu with lowres
Fixes a few green artifacts at the top
Fixes rest of Ticket 2535

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c67bca2b5a)
2013-05-09 17:21:12 +02:00
Michael Niedermayer
84df0dc40b avcodec/mpegvideo: Fix block height for lowres 3 interlaced blocks
Fixes green trash
Fixes part of Ticket2535

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bca50e5cd5)
2013-05-09 17:20:52 +02:00
Reimar Döffinger
a857811c75 matroska: set "done" only during resync fail.
Fixes playback of test7.mkv validation test file.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 762d4335ae)
2013-05-09 17:19:37 +02:00
Clément Bœsch
3d6219b6db lavfi/subtitles: zero-init AVSubtitle.
This avoids invalid free when the stream id doesn't match the packet
stream index.

Ticket #2501
(cherry picked from commit 035a3792c2)
2013-05-09 17:05:02 +02:00
Carl Eugen Hoyos
0a53c7016f Fix type of shared flac table ff_flac_blocksize_table[].
Fixes ticket #2533.
(cherry picked from commit a07ac1f788)
2013-05-05 20:39:56 +02:00
Janne Grunau
f0dc5c0419 vaapi: fix argument for ff_vaapi_common_end_frame call
(cherry picked from commit b066d90211)
2013-04-13 10:09:50 +02:00
Nicolas George
df8c36265a lavc: fix recoded subtitles end.
Text subtitles packets are not 0-terminated (and if they are,
it is handled by the recoding process since 0 is a valid
Unicode code point). The terminating 0 would overwrite the
last payload octet.

OTOH, packets must be 0-padded.

Fix a problem reported in trac ticket #2431.
2013-04-07 15:36:10 +02:00
Carl Eugen Hoyos
c351d8781d Skip padding in an id3 tag in aiff files.
Fixes ticket #2430.

Reviewed-by: Matthieu Bouron
(cherry picked from commit db2d3a9082)
2013-04-03 23:22:11 +02:00
Paul B Mahol
d553a522b9 smacker: fix off by one error
Regression since a93b572ae4.

Fixes #2426.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit e3cc92a623)
2013-04-03 15:16:06 +02:00
Carl Eugen Hoyos
0b6d5f27c8 Write broken aac frames to mov files instead of skipping them.
Fixes decoding with picky media players.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b448c0a68d)
2013-04-02 12:50:05 +02:00
Carl Eugen Hoyos
9ecfd7daa3 Only test the first frame for missing aac_adtstoasc bistream filter.
Many players ignore broken aac frames, so don't abort mov or flv
muxing when encountering one, just print a warning instead.

Fixes ticket #2380.
(cherry picked from commit 1741fece70)
2013-03-27 00:50:39 +01:00
Diego Biurrun
90f1aa38b6 configure: Enable hwaccels without external dependencies by default.
Fixes ticket #2368.
(cherry picked from commit 2e2ec66741)
2013-03-22 13:24:16 +01:00
Carl Eugen Hoyos
fc5c81ce0a Do not (re-)set libx264 parameter b_tff if interlaced encoding was not requested.
Reconfiguring can break x264 lossless encoding.

Fixes ticket #2165.
(cherry picked from commit 75c7e4583f)
2013-03-18 02:11:30 +01:00
Fabrizio Gennari
e820e3a259 mem: Fix usage of memalign() on DJGPP.
Credits to Khusraw of bttr-software.de forum.
Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
(cherry picked from commit 91b747ac78)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 23:30:35 +01:00
Michael Niedermayer
17911d0a96 release_notes: update
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 23:30:35 +01:00
Michael Niedermayer
2ed7f5a670 Changelog: update version
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 23:30:35 +01:00
Michael Niedermayer
7c6c5767eb jpegdec: be less picky on padding
Fixes Ticket2353

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c24fbbf65)
2013-03-14 21:59:42 +01:00
Michael Niedermayer
0ec869527c mpegts: clear avprograms only for removed programs
Fixes Ticket2186

Requested-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 806a66fd08)
2013-03-10 09:55:39 +01:00
Carl Eugen Hoyos
0b198e38c5 Revert "build: disable iconv by default."
This reverts commit 9ad3cd5b5f.

The misdetection on OS X should be fixed, we will only get
problem reports if auto-detection is enabled.
(cherry picked from commit 3f78f0904b)
2013-03-10 09:55:25 +01:00
Michael Niedermayer
1ea3248290 Update for FFmpeg 1.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-09 14:31:52 +01:00
Michael Niedermayer
bdd2db60c2 MAINTAINERS: update for 1.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-08 14:45:46 +01:00
37 changed files with 115 additions and 58 deletions

View File

@@ -1,7 +1,7 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version <next>:
version 1.2:
- VDPAU hardware acceleration through normal hwaccel
- SRTP support

View File

@@ -445,9 +445,9 @@ x86 Michael Niedermayer
Releases
========
1.2 Michael Niedermayer
1.1 Michael Niedermayer
1.0 Michael Niedermayer
0.11 Michael Niedermayer

View File

@@ -1 +1 @@
1.1.git
1.2.1

1
VERSION Normal file
View File

@@ -0,0 +1 @@
1.2.1

View File

@@ -190,13 +190,13 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
void show_help_children(const AVClass *class, int flags);
/**
* Per-avtool specific help handler. Implemented in each
* avtool, called by show_help().
* Per-fftool specific help handler. Implemented in each
* fftool, called by show_help().
*/
void show_help_default(const char *opt, const char *arg);
/**
* Generic -h handler common to all avtools.
* Generic -h handler common to all fftools.
*/
int show_help(void *optctx, const char *opt, const char *arg);

7
configure vendored
View File

@@ -188,7 +188,7 @@ External library support:
--enable-fontconfig enable fontconfig
--enable-frei0r enable frei0r video filtering
--enable-gnutls enable gnutls [no]
--enable-iconv enable iconv [no]
--enable-iconv enable iconv [autodetect]
--enable-libaacplus enable AAC+ encoding via libaacplus [no]
--enable-libass enable libass subtitles rendering [no]
--enable-libbluray enable BluRay reading using libbluray [no]
@@ -2169,6 +2169,9 @@ enable safe_bitstream_reader
enable static
enable swscale_alpha
# By default, enable only those hwaccels that have no external dependencies.
enable dxva2 vdpau
# build settings
SHFLAGS='-shared -Wl,-soname,$$(@F)'
FFSERVERLDFLAGS=-Wl,-E
@@ -4053,7 +4056,7 @@ enabled vdpau &&
disable vdpau
# Funny iconv installations are not unusual, so check it after all flags have been set
enabled iconv && { check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || die "ERROR: iconv not found"; }
disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"

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 = 1.2.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,7 +1,7 @@
Release Notes
=============
* 0.10 "Freedom" January, 2012
* 1.2 "Magic" March, 2013
General notes
@@ -14,9 +14,3 @@ accepted. If you are experiencing issues with any formally released version of
FFmpeg, please try git master to check if the issue still exists. If it does,
make your report against the development code following the usual bug reporting
guidelines.
Of big interest to our Windows users, FFmpeg now supports building with the MSVC
compiler. Since MSVC does not support C99 features used extensively by FFmpeg,
this has been accomplished using a converter that turns C99 code to C89. See the
platform-specific documentation for more detailed documentation on building
FFmpeg with MSVC.

View File

@@ -300,7 +300,9 @@ static int cdg_decode_frame(AVCodecContext *avctx,
inst = bytestream_get_byte(&buf);
inst &= CDG_MASK;
buf += 2; /// skipping 2 unneeded bytes
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
if (buf_size > CDG_HEADER_SIZE)
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
if ((command & CDG_MASK) == CDG_COMMAND) {
switch (inst) {

View File

@@ -212,6 +212,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
buf[803] = s->bits_per_component;
write16(buf + 804, (s->bits_per_component == 10 || s->bits_per_component == 12) ?
1 : 0); /* packing method */
write32(buf + 808, HEADER_SIZE); /* data offset */
/* Image source information header */
write32(buf + 1628, avctx->sample_aspect_ratio.num);

View File

@@ -348,7 +348,8 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
const uint8_t *src;
int axmax = (avctx->width - (s->xmax + 1)) * 2 * s->desc->nb_components;
int bxmin = s->xmin * 2 * s->desc->nb_components;
int ret, i, x, buf_size = s->buf_size;
int i, x, buf_size = s->buf_size;
int av_unused ret;
line_offset = AV_RL64(s->table + jobnr * 8);
// Check if the buffer has the required bytes needed from the offset

View File

@@ -27,7 +27,7 @@ const int ff_flac_sample_rate_table[16] =
8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
0, 0, 0, 0 };
const int16_t ff_flac_blocksize_table[16] = {
const int32_t ff_flac_blocksize_table[16] = {
0, 192, 576<<0, 576<<1, 576<<2, 576<<3, 0, 0,
256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
};

View File

@@ -26,6 +26,6 @@
extern const int ff_flac_sample_rate_table[16];
extern const int16_t ff_flac_blocksize_table[16];
extern const int32_t ff_flac_blocksize_table[16];
#endif /* AVCODEC_FLACDATA_H */

View File

@@ -462,6 +462,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
if (s->keyframe) {
s->keyframe_ok = 0;
s->gce_prev_disposal = GCE_DISPOSAL_NONE;
if ((ret = gif_read_header1(s)) < 0)
return ret;

View File

@@ -175,7 +175,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
X264_TYPE_AUTO;
if (x4->params.b_tff != frame->top_field_first) {
if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) {
x4->params.b_tff = frame->top_field_first;
x264_encoder_reconfig(x4->enc, &x4->params);
}

View File

@@ -747,7 +747,9 @@ static void handle_rstn(MJpegDecodeContext *s, int nb_components)
i = 8 + ((-get_bits_count(&s->gb)) & 7);
/* skip RSTn */
if (s->restart_count == 0 && show_bits(&s->gb, i) == (1 << i) - 1) {
if (s->restart_count == 0) {
if( show_bits(&s->gb, i) == (1 << i) - 1
|| show_bits(&s->gb, i) == 0xFF) {
int pos = get_bits_count(&s->gb);
align_get_bits(&s->gb);
while (get_bits_left(&s->gb) >= 8 && show_bits(&s->gb, 8) == 0xFF)
@@ -757,6 +759,7 @@ static void handle_rstn(MJpegDecodeContext *s, int nb_components)
s->last_dc[i] = 1024;
} else
skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
}
}
}
}
@@ -1636,6 +1639,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
MJpegDecodeContext *s = avctx->priv_data;
const uint8_t *buf_end, *buf_ptr;
const uint8_t *unescaped_buf_ptr;
int hshift, vshift;
int unescaped_buf_size;
int start_code;
int i, index;
@@ -1814,6 +1818,9 @@ the_end:
}
if (s->upscale_v) {
uint8_t *dst = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(s->height - 1) * s->linesize[s->upscale_v]];
int w;
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
w = s->width >> hshift;
av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
@@ -1822,16 +1829,16 @@ the_end:
uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[i / 2 * s->linesize[s->upscale_v]];
uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(i + 1) / 2 * s->linesize[s->upscale_v]];
if (src1 == src2) {
memcpy(dst, src1, s->width);
memcpy(dst, src1, w);
} else {
for (index = 0; index < s->width; index++)
for (index = 0; index < w; index++)
dst[index] = (src1[index] + src2[index]) >> 1;
}
dst -= s->linesize[s->upscale_v];
}
}
if (s->flipped && (s->avctx->flags & CODEC_FLAG_EMU_EDGE)) {
int hshift, vshift, j;
int j;
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
for (index=0; index<4; index++) {
uint8_t *dst = s->picture_ptr->data[index];

View File

@@ -104,6 +104,9 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
if (half_horiz)
run_length *=2;
if (run_length > s->avctx->width - x)
return AVERROR_INVALIDDATA;
if (color) {
memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
if (half_vert)
@@ -151,6 +154,8 @@ static int mm_decode_inter(MmContext * s, int half_horiz, int half_vert)
int replace_array = bytestream2_get_byte(&s->gb);
for(j=0; j<8; j++) {
int replace = (replace_array >> (7-j)) & 1;
if (x + half_horiz >= s->avctx->width)
return AVERROR_INVALIDDATA;
if (replace) {
int color = bytestream2_get_byte(&data_ptr);
s->frame.data[0][y*s->frame.linesize[0] + x] = color;

View File

@@ -2221,7 +2221,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) ||
if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) || uvsrc_y<0 ||
(unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,
linesize >> field_based, 17, 17 + field_based,
@@ -2261,11 +2261,12 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
pix_op[lowres - 1](dest_y, ptr_y, linesize, h, sx, sy);
if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h;
uvsx = (uvsx << 2) >> lowres;
uvsy = (uvsy << 2) >> lowres;
if (h >> s->chroma_y_shift) {
pix_op[op_index](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
pix_op[op_index](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
if (hc) {
pix_op[op_index](dest_cb, ptr_cb, uvlinesize, hc, uvsx, uvsy);
pix_op[op_index](dest_cr, ptr_cr, uvlinesize, hc, uvsx, uvsy);
}
}
// FIXME h261 lowres loop filter

View File

@@ -739,6 +739,11 @@ static int process_frame_obj(SANMVideoContext *ctx)
w = bytestream2_get_le16u(&ctx->gb);
h = bytestream2_get_le16u(&ctx->gb);
if (!w || !h) {
av_log(ctx->avctx, AV_LOG_ERROR, "dimensions are invalid\n");
return AVERROR_INVALIDDATA;
}
if (ctx->width < left + w || ctx->height < top + h) {
if (av_image_check_size(FFMAX(left + w, ctx->width),
FFMAX(top + h, ctx->height), 0, ctx->avctx) < 0)

View File

@@ -1938,7 +1938,7 @@ static int recode_subtitle(AVCodecContext *avctx,
goto end;
}
outpkt->size -= outl;
outpkt->data[outpkt->size - 1] = '\0';
memset(outpkt->data + outpkt->size, 0, outl);
end:
if (cd != (iconv_t)-1)

View File

@@ -212,7 +212,7 @@ int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
finish:
ff_vaapi_common_end_frame(avctx->priv_data);
ff_vaapi_common_end_frame(avctx);
return ret;
}

View File

@@ -162,7 +162,7 @@ static int rle_unpack(const unsigned char *src, int src_len, int src_count,
const unsigned char *ps;
const unsigned char *ps_end;
unsigned char *pd;
int i, l;
int i, j, l;
unsigned char *dest_end = dest + dest_len;
ps = src;
@@ -188,9 +188,9 @@ static int rle_unpack(const unsigned char *src, int src_len, int src_count,
ps += l;
pd += l;
} else {
if (dest_end - pd < i || ps_end - ps < 2)
if (dest_end - pd < 2*l || ps_end - ps < 2)
return ps - src;
for (i = 0; i < l; i++) {
for (j = 0; j < l; j++) {
*pd++ = ps[0];
*pd++ = ps[1];
}

View File

@@ -59,7 +59,7 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data,
int number, len;
ptr += strcspn(ptr, "#");
if (sscanf(ptr, "#define %256s %u", name, &number) != 2) {
if (sscanf(ptr, "#define %255s %u", name, &number) != 2) {
av_log(avctx, AV_LOG_ERROR, "Unexpected preprocessor directive\n");
return AVERROR_INVALIDDATA;
}

View File

@@ -91,13 +91,13 @@ static int movie_request_frame(AVFilterLink *outlink);
static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec)
{
int i, ret, already = 0, stream_id = -1;
char type_char, dummy;
char type_char[2], dummy;
AVStream *found = NULL;
enum AVMediaType type;
ret = sscanf(spec, "d%[av]%d%c", &type_char, &stream_id, &dummy);
ret = sscanf(spec, "d%1[av]%d%c", type_char, &stream_id, &dummy);
if (ret >= 1 && ret <= 2) {
type = type_char == 'v' ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;
type = type_char[0] == 'v' ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;
ret = av_find_best_stream(avf, type, stream_id, -1, NULL, 0);
if (ret < 0) {
av_log(log, AV_LOG_ERROR, "No %s stream with index '%d' found\n",

View File

@@ -332,7 +332,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
pkt.size = 0;
while (av_read_frame(fmt, &pkt) >= 0) {
int i, got_subtitle;
AVSubtitle sub;
AVSubtitle sub = {0};
if (pkt.stream_index == sid) {
ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_subtitle, &pkt);

View File

@@ -192,7 +192,7 @@ static int aiff_probe(AVProbeData *p)
static int aiff_read_header(AVFormatContext *s)
{
int ret, size, filesize;
int64_t offset = 0;
int64_t offset = 0, position;
uint32_t tag;
unsigned version = AIFF_C_VERSION1;
AVIOContext *pb = s->pb;
@@ -236,6 +236,7 @@ static int aiff_read_header(AVFormatContext *s)
goto got_sound;
break;
case MKTAG('I', 'D', '3', ' '):
position = avio_tell(pb);
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
if (id3v2_extra_meta)
if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0) {
@@ -243,6 +244,8 @@ static int aiff_read_header(AVFormatContext *s)
return ret;
}
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
if (position + size > avio_tell(pb))
avio_skip(pb, position + size - avio_tell(pb));
break;
case MKTAG('F', 'V', 'E', 'R'): /* Version chunk */
version = avio_rb32(pb);

View File

@@ -493,10 +493,13 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
} else if (enc->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
if (!s->streams[pkt->stream_index]->nb_frames) {
av_log(s, AV_LOG_ERROR, "Malformed AAC bitstream detected: "
"use audio bitstream filter 'aac_adtstoasc' to fix it "
"('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
return AVERROR_INVALIDDATA;
}
av_log(s, AV_LOG_WARNING, "aac bitstream error\n");
}
if (flv->delay == AV_NOPTS_VALUE)

View File

@@ -1916,10 +1916,10 @@ static void matroska_clear_queue(MatroskaDemuxContext *matroska)
}
static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
int size, int type,
int* buf_size, int type,
uint32_t **lace_buf, int *laces)
{
int res = 0, n;
int res = 0, n, size = *buf_size;
uint8_t *data = *buf;
uint32_t *lace_size;
@@ -2017,6 +2017,7 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
*buf = data;
*lace_buf = lace_size;
*buf_size = size;
return res;
}
@@ -2252,7 +2253,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
matroska->skip_to_keyframe = 0;
}
res = matroska_parse_laces(matroska, &data, size, (flags & 0x06) >> 1,
res = matroska_parse_laces(matroska, &data, &size, (flags & 0x06) >> 1,
&lace_size, &laces);
if (res)
@@ -2359,7 +2360,6 @@ static int matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
}
}
if (res < 0) matroska->done = 1;
return res;
}

View File

@@ -3173,6 +3173,14 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
memcpy(trk->vos_data, enc->extradata, trk->vos_len);
}
if (enc->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
if (!s->streams[pkt->stream_index]->nb_frames) {
av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
return -1;
}
av_log(s, AV_LOG_WARNING, "aac bitstream error\n");
}
if (enc->codec_id == AV_CODEC_ID_H264 && trk->vos_len > 0 && *(uint8_t *)trk->vos_data != 1) {
/* from x264 or from bytestream h264 */
/* nal reformating needed */
@@ -3183,10 +3191,6 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
} else {
size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
}
} else if (enc->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
return -1;
} else {
avio_write(pb, pkt->data, size);
}

View File

@@ -208,9 +208,6 @@ static void clear_program(MpegTSContext *ts, unsigned int programid)
static void clear_programs(MpegTSContext *ts)
{
int i;
for(i=0; i<ts->nb_prg; i++)
clear_avprogram(ts, ts->prg[i].id);
av_freep(&ts->prg);
ts->nb_prg=0;
}
@@ -1636,6 +1633,17 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
add_pid_to_pmt(ts, sid, pmt_pid);
}
}
if (sid < 0) {
int i,j;
for (j=0; j<ts->stream->nb_programs; j++) {
for (i=0; i<ts->nb_prg; i++)
if (ts->prg[i].id == ts->stream->programs[j]->id)
break;
if (i==ts->nb_prg)
clear_avprogram(ts, ts->stream->programs[j]->id);
}
}
}
static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)

View File

@@ -1000,6 +1000,18 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
return dts;
}
static int rm_read_seek(AVFormatContext *s, int stream_index,
int64_t pts, int flags)
{
RMDemuxContext *rm = s->priv_data;
if (ff_seek_frame_binary(s, stream_index, pts, flags) < 0)
return -1;
rm->audio_pkt_cnt = 0;
return 0;
}
AVInputFormat ff_rm_demuxer = {
.name = "rm",
.long_name = NULL_IF_CONFIG_SMALL("RealMedia"),
@@ -1009,6 +1021,7 @@ AVInputFormat ff_rm_demuxer = {
.read_packet = rm_read_packet,
.read_close = rm_read_close,
.read_timestamp = rm_read_dts,
.read_seek = rm_read_seek,
};
AVInputFormat ff_rdt_demuxer = {

View File

@@ -276,7 +276,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
} else if(t & 0x40){ /* copy with offset */
off = avio_r8(s->pb);
j = (t & 0x3F) + 1;
if (off + j > 0xff) {
if (off + j - 1 > 0xff) {
av_log(s, AV_LOG_ERROR,
"Invalid palette update, offset=%d length=%d extends beyond palette size\n",
off, j);

View File

@@ -26,6 +26,7 @@
*/
#include <stdint.h>
#include "common.h"
#include "mathematics.h"
#include "intfloat_readwrite.h"
@@ -88,7 +89,7 @@ AVExtFloat av_dbl2ext(double d){
ext.mantissa[i] = m>>(56-(i<<3));
} else if (f != 0.0) {
ext.exponent[0] = 0x7f; ext.exponent[1] = 0xff;
if (f != INFINITY)
if (!isinf(f))
ext.mantissa[0] = ~0;
}
if (d < 0)

View File

@@ -178,7 +178,7 @@ static void format_line(void *ptr, int level, const char *fmt, va_list vl,
if (parent && *parent) {
snprintf(part[0], part_size, "[%s @ %p] ",
(*parent)->item_name(parent), parent);
if(type) type[0] = get_category(((uint8_t *) ptr) + avc->parent_log_context_offset);
if(type) type[0] = get_category(parent);
}
}
snprintf(part[1], part_size, "[%s @ %p] ",

View File

@@ -95,7 +95,11 @@ void *av_malloc(size_t size)
#elif HAVE_ALIGNED_MALLOC
ptr = _aligned_malloc(size, ALIGN);
#elif HAVE_MEMALIGN
#ifndef __DJGPP__
ptr = memalign(ALIGN, size);
#else
ptr = memalign(size, ALIGN);
#endif
/* Why 64?
* Indeed, we should align it:
* on 4 for 386

View File

@@ -1 +1 @@
a39d7e299a8e25b4ffece0f8d64bf19e
9615088d613931b50fd5016c7535b99a

View File

@@ -1,9 +1,9 @@
808ea110635774252439722a48329d61 *./tests/data/images/dpx/02.dpx
d2f0b4e854fda2d3b3bee84cef80593c *./tests/data/images/dpx/02.dpx
./tests/data/images/dpx/%02d.dpx CRC=0x6da01946
305792 ./tests/data/images/dpx/02.dpx
5e1a777fa3f4094c9c4dd989cf9e8e8b *./tests/data/images/dpx/02.dpx
075963c3c08978b6a20555ba09161434 *./tests/data/images/dpx/02.dpx
./tests/data/images/dpx/%02d.dpx CRC=0xe5b9c023
609920 ./tests/data/images/dpx/02.dpx
13dc41b1e1e36399a5e1f8b7e3344a81 *./tests/data/images/dpx/02.dpx
b9f22728f8ff393bf30cf6cbd624fa95 *./tests/data/images/dpx/02.dpx
./tests/data/images/dpx/%02d.dpx CRC=0xb6310a70
407168 ./tests/data/images/dpx/02.dpx