Compare commits

...

22 Commits

Author SHA1 Message Date
b06903e6c5 Changelog for 0.11.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-19 03:11:27 +02:00
a5069caecd arm/intmath: disable av_clip_uintp2_arm with config_small
The code otherwise breaks compilation (gcc 4.5 tested but probably any compiler)

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 00:52:42 +02:00
b5e72345a6 Update for 0.11.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 00:27:17 +02:00
99dbda3008 aasc: fix out of array write
Closes #1619.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 00:21:58 +02:00
d721cb009d bmv_videodec: fix out of array read
Fixes Ticket1373

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 00:21:22 +02:00
55b3e408fa faxcompr: fix out of array read
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5891e454a6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 00:20:38 +02:00
9f1e01c991 escape124: fix integer overflow leading to excessive memory allocation
Fixes Ticket1629

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 00:18:39 +02:00
450e4b1a60 sp5xdec: fix off by 1 error causing a crash
Fixes Ticket1633

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 00:16:27 +02:00
3581ab6ce0 mpegaudio_parser: reset state to prevent it to be random
Fixes Ticket1718

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 00:15:35 +02:00
f1ec792ae3 pthread: Avoid crashes/odd behavior caused by spurious wakeups
pthread_wait_cond can wake up for no reason (Wikipedia: Spurious_wakeup).
The FF_THREAD_SLICE thread mechanism could spontaneously execute jobs or
allow the caller of avctx->execute to return before all jobs were complete.
This adds tests to both cases to ensure the wakeup is real.

Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e3329474a3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 00:15:02 +02:00
05e64b51bb lavfi/aresample: set buffer properties after copy.
The aresample filter changes the format, layout and/or sample rate,
it can not copy them blindly from its input.

Fix trac ticket 1671 because af_volume uses the properties from the
buffer and not from the link.
2012-09-13 11:52:49 +02:00
3593f577b0 lavfi/audio: fix an invalid boundary check. 2012-09-13 11:52:49 +02:00
72791e41d4 Fix muxing mjpeg in swf.
(cherry picked from commit 7680d99b43)
2012-09-13 09:21:26 +02:00
4155968fc6 build: Fix some paths in uninstall-libs
Folder and file names weren't being separated with a slash.
This resulted in .dll.a, .lib and .def files not being removed on uninstall.

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
(cherry picked from commit 49440853d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-13 04:47:46 +02:00
d14ce69869 doc/Makefile: Add missing $(HOSTEXESUF) to print_options
(cherry picked from commit d48f014ff1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-13 04:47:20 +02:00
b45a8f6d24 dxva2: include dxva.h if found
Apparently, some build environments require dxva.h even for dxva2,
while others lack this header entirely.  Including it conditionally
allows building in both cases.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit fa84506177)

Conflicts:

	configure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-13 04:46:50 +02:00
ae8491ce33 configure: fix sctp check.
This fixes build failures on debian/kfreebsd

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

Conflicts:

	configure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-13 04:45:57 +02:00
3f78fe1d56 Clarify that -passlogfile has a different syntax when used with -vcodec libx264. 2012-08-31 14:16:36 +02:00
fb52da522c oggdec: Initialize stream index to -1 in ogg_packet.
The previous method of having to initialize it outside lead
to incorrect code: even if it was initialized, it usually was
only initialized once, thus a packet that could not be matched
to any stream would just be processed with the return values
from the previous call.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 69aeba1396)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-06 16:52:18 +02:00
5231a35559 oggdec: simplify start time calculation code.
Also slightly more correct behaviour in case streams_left for
some reason is 0 from the start.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit a4163b2d65)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-06 16:52:09 +02:00
606538df6c oggdec: check stream index before using it in ogg_get_length()
Fixes crash based on a uninitialized array index read.
If the read does not crash then out of array writes based
on the same index might have been triggered afterwards.

Found-by: inferno@chromium.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9e1c55cfde)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-06 16:51:59 +02:00
a19010f7a6 wmaenc: dont mess with the bitrate.
The bitrate is not writeable by an encoder.
Fixes generation of invalid wma

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-02 13:29:41 +02:00
22 changed files with 74 additions and 29 deletions

View File

@ -3,6 +3,12 @@ releases are sorted from youngest to oldest.
version next:
version 0.11.2:
- Several bugs and crashes have been fixed as well as build problems
with recent mingw64
version 0.11:
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,

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 = 0.11.1
PROJECT_NUMBER = 0.11.2
# 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.11.1
0.11.2

View File

@ -1 +1 @@
0.11.1
0.11.2

8
configure vendored
View File

@ -1173,6 +1173,7 @@ HAVE_LIST="
dlfcn_h
dlopen
dos_paths
dxva_h
ebp_available
ebx_available
exp2
@ -1217,7 +1218,6 @@ HAVE_LIST="
memalign
mkstemp
mmap
netinet_sctp_h
PeekNamedPipe
poll_h
posix_memalign
@ -1237,6 +1237,7 @@ HAVE_LIST="
struct_addrinfo
struct_ipv6_mreq
struct_rusage_ru_maxrss
struct_sctp_event_subscribe
struct_sockaddr_in6
struct_sockaddr_sa_len
struct_sockaddr_storage
@ -1665,7 +1666,7 @@ mmst_protocol_deps="network"
rtmp_protocol_deps="!librtmp_protocol"
rtmp_protocol_select="tcp_protocol"
rtp_protocol_select="udp_protocol"
sctp_protocol_deps="network netinet_sctp_h"
sctp_protocol_deps="network struct_sctp_event_subscribe"
tcp_protocol_deps="network"
tls_protocol_deps_any="openssl gnutls"
tls_protocol_select="tcp_protocol"
@ -3070,7 +3071,7 @@ if enabled network; then
check_type netinet/in.h "struct sockaddr_in6"
check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
check_header netinet/sctp.h
check_type netinet/sctp.h "struct sctp_event_subscribe"
# Prefer arpa/inet.h over winsock2
if check_header arpa/inet.h ; then
check_func closesocket
@ -3125,6 +3126,7 @@ check_func_headers windows.h VirtualAlloc
check_func_headers glob.h glob
check_header dlfcn.h
check_header dxva.h
check_header dxva2api.h -D_WIN32_WINNT=0x0600
check_header libcrystalhd/libcrystalhd_if.h
check_header malloc.h

View File

@ -35,7 +35,7 @@ GENTEXI = format codec
GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
$(GENTEXI): TAG = GENTEXI
$(GENTEXI): doc/avoptions_%.texi: doc/print_options
$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
$(M)doc/print_options $* > $@
doc/%.html: TAG = HTML

View File

@ -340,6 +340,10 @@ prefix is ``ffmpeg2pass''. The complete file name will be
@file{PREFIX-N.log}, where N is a number specific to the output
stream
Note that this option is overwritten by a local option of the same name
when using @code{-vcodec libx264}. That option maps to the x264 option stats
which has a different syntax.
@item -vlang @var{code}
Set the ISO 639 language code (3 letters) of the current video stream.

View File

@ -66,7 +66,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AascContext *s = avctx->priv_data;
int compr, i, stride;
int compr, i, stride, psize;
s->frame.reference = 3;
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
@ -78,6 +78,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
compr = AV_RL32(buf);
buf += 4;
buf_size -= 4;
psize = avctx->bits_per_coded_sample / 8;
switch (avctx->codec_tag) {
case MKTAG('A', 'A', 'S', '4'):
bytestream2_init(&s->gb, buf - 4, buf_size + 4);
@ -86,13 +87,13 @@ static int aasc_decode_frame(AVCodecContext *avctx,
case MKTAG('A', 'A', 'S', 'C'):
switch(compr){
case 0:
stride = (avctx->width * 3 + 3) & ~3;
stride = (avctx->width * psize + psize) & ~psize;
for(i = avctx->height - 1; i >= 0; i--){
if(avctx->width*3 > buf_size){
if(avctx->width * psize > buf_size){
av_log(avctx, AV_LOG_ERROR, "Next line is beyond buffer bounds\n");
break;
}
memcpy(s->frame.data[0] + i*s->frame.linesize[0], buf, avctx->width*3);
memcpy(s->frame.data[0] + i*s->frame.linesize[0], buf, avctx->width * psize);
buf += stride;
buf_size -= stride;
}

View File

@ -268,6 +268,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
if (avctx->width != SCREEN_WIDE || avctx->height != SCREEN_HIGH) {
av_log(avctx, AV_LOG_ERROR, "Invalid dimension %dx%d\n", avctx->width, avctx->height);
return AVERROR_INVALIDDATA;
}
c->pic.reference = 1;
if (avctx->get_buffer(avctx, &c->pic) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

View File

@ -25,7 +25,14 @@
#define _WIN32_WINNT 0x0600
#define COBJMACROS
#include "config.h"
#include "dxva2.h"
#if HAVE_DXVA_H
#include <dxva.h>
#endif
#include "avcodec.h"
#include "mpegvideo.h"

View File

@ -48,7 +48,7 @@ typedef struct Escape124Context {
CodeBook codebooks[3];
} Escape124Context;
static int can_safely_read(GetBitContext* gb, int bits) {
static int can_safely_read(GetBitContext* gb, uint64_t bits) {
return get_bits_left(gb) >= bits;
}
@ -90,7 +90,7 @@ static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth,
unsigned i, j;
CodeBook cb = { 0 };
if (!can_safely_read(gb, size * 34))
if (!can_safely_read(gb, size * 34L))
return cb;
if (size >= INT_MAX / sizeof(MacroBlock))

View File

@ -228,7 +228,7 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
mode = !mode;
}
//sync line pointers
while(run_off <= offs){
while(offs < width && run_off <= offs){
run_off += *ref++;
run_off += *ref++;
}

View File

@ -53,6 +53,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
int inc= FFMIN(buf_size - i, s->frame_size);
i += inc;
s->frame_size -= inc;
state = 0;
if(!s->frame_size){
next= i;

View File

@ -79,6 +79,7 @@ typedef struct ThreadContext {
pthread_cond_t current_job_cond;
pthread_mutex_t current_job_lock;
int current_job;
unsigned int current_execute;
int done;
} ThreadContext;
@ -203,6 +204,7 @@ static void* attribute_align_arg worker(void *v)
AVCodecContext *avctx = v;
ThreadContext *c = avctx->thread_opaque;
int our_job = c->job_count;
int last_execute = 0;
int thread_count = avctx->thread_count;
int self_id;
@ -213,7 +215,9 @@ static void* attribute_align_arg worker(void *v)
if (c->current_job == thread_count + c->job_count)
pthread_cond_signal(&c->last_job_cond);
pthread_cond_wait(&c->current_job_cond, &c->current_job_lock);
while (last_execute == c->current_execute && !c->done)
pthread_cond_wait(&c->current_job_cond, &c->current_job_lock);
last_execute = c->current_execute;
our_job = self_id;
if (c->done) {
@ -233,7 +237,8 @@ static void* attribute_align_arg worker(void *v)
static av_always_inline void avcodec_thread_park_workers(ThreadContext *c, int thread_count)
{
pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);
while (c->current_job != thread_count + c->job_count)
pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);
pthread_mutex_unlock(&c->current_job_lock);
}
@ -282,6 +287,7 @@ static int avcodec_thread_execute(AVCodecContext *avctx, action_func* func, void
c->rets = &dummy_ret;
c->rets_count = 1;
}
c->current_execute++;
pthread_cond_broadcast(&c->current_job_cond);
avcodec_thread_park_workers(c, avctx->thread_count);

View File

@ -72,7 +72,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
for (i = 2; i < buf_size-2 && j < buf_size+1024-2; i++)
recoded[j++] = buf[i];
else
for (i = 14; i < buf_size && j < buf_size+1024-2; i++)
for (i = 14; i < buf_size && j < buf_size+1024-3; i++)
{
recoded[j++] = buf[i];
if (buf[i] == 0xff)

View File

@ -85,8 +85,6 @@ static int encode_init(AVCodecContext * avctx){
(avctx->sample_rate * 8);
s->block_align = FFMIN(s->block_align, MAX_CODED_SUPERFRAME_SIZE);
avctx->block_align = s->block_align;
avctx->bit_rate = avctx->block_align * 8LL * avctx->sample_rate /
s->frame_len;
//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d\n", s->block_align, avctx->bit_rate, s->frame_len, avctx->sample_rate);
avctx->frame_size = avctx->delay = s->frame_len;

View File

@ -176,6 +176,9 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
avfilter_copy_buffer_ref_props(outsamplesref, insamplesref);
outsamplesref->format = outlink->format;
outsamplesref->audio->channel_layout = outlink->channel_layout;
outsamplesref->audio->sample_rate = outlink->sample_rate;
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);

View File

@ -204,7 +204,7 @@ void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate;
/* Copy actual data into new samples buffer */
for (i = 0; samplesref->data[i] && i < 8; i++)
for (i = 0; i < 8 && samplesref->data[i]; i++)
memcpy(link->cur_buf->data[i], samplesref->data[i], samplesref->linesize[0]);
for (i = 0; i < planes; i++)
memcpy(link->cur_buf->extended_data[i], samplesref->extended_data[i], samplesref->linesize[0]);

View File

@ -336,6 +336,13 @@ static int ogg_read_page(AVFormatContext *s, int *str)
return 0;
}
/**
* @brief find the next Ogg packet
* @param *str is set to the stream for the packet or -1 if there is
* no matching stream, in that case assume all other return
* values to be uninitialized.
* @return negative value on error or EOF.
*/
static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
int64_t *fpos)
{
@ -346,6 +353,8 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
int segp = 0, psize = 0;
av_dlog(s, "ogg_packet: curidx=%i\n", ogg->curidx);
if (str)
*str = -1;
do{
idx = ogg->curidx;
@ -524,8 +533,10 @@ static int ogg_get_length(AVFormatContext *s)
ogg_save (s);
avio_seek (s->pb, s->data_offset, SEEK_SET);
ogg_reset(s);
while (!ogg_packet(s, &i, NULL, NULL, NULL)) {
int64_t pts = ogg_calc_pts(s, i, NULL);
while (streams_left > 0 && !ogg_packet(s, &i, NULL, NULL, NULL)) {
int64_t pts;
if (i < 0) continue;
pts = ogg_calc_pts(s, i, NULL);
if (pts != AV_NOPTS_VALUE && s->streams[i]->start_time == AV_NOPTS_VALUE && !ogg->streams[i].got_start){
s->streams[i]->duration -= pts;
ogg->streams[i].got_start= 1;
@ -534,8 +545,6 @@ static int ogg_get_length(AVFormatContext *s)
ogg->streams[i].got_start= 1;
streams_left--;
}
if(streams_left<=0)
break;
}
ogg_restore (s, 0);
@ -610,7 +619,7 @@ static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt)
{
struct ogg *ogg;
struct ogg_stream *os;
int idx = -1, ret;
int idx, ret;
int pstart, psize;
int64_t fpos, pts, dts;
@ -669,7 +678,7 @@ static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
AVIOContext *bc = s->pb;
int64_t pts = AV_NOPTS_VALUE;
int64_t keypos = -1;
int i = -1;
int i;
int pstart, psize;
avio_seek(bc, *pos_arg, SEEK_SET);
ogg_reset(s);

View File

@ -494,8 +494,10 @@ static int swf_write_trailer(AVFormatContext *s)
avio_wl32(pb, file_size);
avio_seek(pb, swf->duration_pos, SEEK_SET);
avio_wl16(pb, swf->video_frame_number);
if (swf->vframes_pos) {
avio_seek(pb, swf->vframes_pos, SEEK_SET);
avio_wl16(pb, swf->video_frame_number);
}
avio_seek(pb, file_size, SEEK_SET);
}
return 0;

View File

@ -75,6 +75,7 @@ static av_always_inline av_const int16_t av_clip_int16_arm(int a)
return x;
}
#if !CONFIG_SMALL //the code below cannot be compiled without always_inline
#define av_clip_uintp2 av_clip_uintp2_arm
static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
{
@ -82,7 +83,7 @@ static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
__asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
return x;
}
#endif //!CONFIG_SMALL
#else /* HAVE_ARMV6 */

View File

@ -82,8 +82,8 @@ uninstall-libs::
-$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
"$(SHLIBDIR)/$(SLIBNAME)" \
"$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
-$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)"%)
-$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)"%)
-$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)/%")
-$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)/%")
-$(RM) "$(LIBDIR)/$(LIBNAME)"
uninstall-headers::