+ffmpeg (7:2.5.2~trusty) trusty; urgency=medium
+
+ * New point release
+
+ -- Doug McMahon <mc631man@gmail.com> Wed, 24 Dec 2014 15:19:46 -0500
+
ffmpeg (7:2.5.1~trusty) trusty; urgency=medium
* New point release
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
+version 2.5.2:
+- avcodec/indeo3: ensure offsets are non negative
+- avcodec/h264: Check *log2_weight_denom
+- avcodec/hevc_ps: Check diff_cu_qp_delta_depth
+- avcodec/h264: Clear delayed_pic on deallocation
+- avcodec/hevc: clear filter_slice_edges() on allocation
+- avcodec/dcadec: Check that the added xch channel isnt already there
+- avcodec/indeo3: use signed variables to avoid underflow
+- swscale: increase yuv2rgb table headroom
+- avformat/mov: fix integer overflow of size
+- avformat/mov: check atom nesting depth
+- avcodec/utvideodec: Fix handling of slice_height=0
+- avcodec/xface: correct the XFACE_MAX_* values
+- avcodec/vmdvideo: Check len before using it in method 3
+- configure: create the tests directory like the doc directory
+- mmvideo: check frame dimensions
+- jvdec: check frame dimensions
+
version 2.5.1:
- lavu/frame: fix malloc error path in av_frame_copy_props()
- avformat/aviobuf: Check that avio_seek() target is non negative
$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
-ffprobe.o cmdutils.o : libavutil/ffversion.h
+ffprobe.o cmdutils.o libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
$(CP) $< $@
mkdir -p doc
+mkdir -p tests
echo "@c auto-generated by configure" > doc/config.texi
print_config ARCH_ "$config_files" $ARCH_LIST
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = 2.5.1
+PROJECT_NUMBER = 2.5.2
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
#else
if (s->xch_present && !s->xch_disable) {
#endif
+ if (avctx->channel_layout & AV_CH_BACK_CENTER) {
+ avpriv_request_sample(avctx, "XCh with Back center channel");
+ return AVERROR_INVALIDDATA;
+ }
avctx->channel_layout |= AV_CH_BACK_CENTER;
if (s->lfe) {
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
if (free_rbsp && h->DPB) {
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
ff_h264_unref_picture(h, &h->DPB[i]);
+ memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
av_freep(&h->DPB);
} else if (h->DPB) {
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
h->luma_log2_weight_denom = get_ue_golomb(&h->gb);
if (h->sps.chroma_format_idc)
h->chroma_log2_weight_denom = get_ue_golomb(&h->gb);
+
+ if (h->luma_log2_weight_denom > 7U) {
+ av_log(h->avctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is out of range\n", h->luma_log2_weight_denom);
+ h->luma_log2_weight_denom = 0;
+ }
+ if (h->chroma_log2_weight_denom > 7U) {
+ av_log(h->avctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out of range\n", h->chroma_log2_weight_denom);
+ h->chroma_log2_weight_denom = 0;
+ }
+
luma_def = 1 << h->luma_log2_weight_denom;
chroma_def = 1 << h->chroma_log2_weight_denom;
* H264Context
*/
typedef struct H264Context {
+ AVClass *av_class;
AVCodecContext *avctx;
MECmpContext mecc;
VideoDSPContext vdsp;
if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
goto fail;
- s->filter_slice_edges = av_malloc(ctb_count);
+ s->filter_slice_edges = av_mallocz(ctb_count);
s->tab_slice_address = av_malloc_array(pic_size_in_ctb,
sizeof(*s->tab_slice_address));
s->qp_y_tab = av_malloc_array(pic_size_in_ctb,
if (pps->cu_qp_delta_enabled_flag)
pps->diff_cu_qp_delta_depth = get_ue_golomb_long(gb);
+ if (pps->diff_cu_qp_delta_depth < 0 ||
+ pps->diff_cu_qp_delta_depth > sps->log2_diff_max_min_coding_block_size) {
+ av_log(s->avctx, AV_LOG_ERROR, "diff_cu_qp_delta_depth %d is invalid\n",
+ pps->diff_cu_qp_delta_depth);
+ ret = AVERROR_INVALIDDATA;
+ goto err;
+ }
+
pps->cb_qp_offset = get_se_golomb(gb);
if (pps->cb_qp_offset < -12 || pps->cb_qp_offset > 12) {
av_log(s->avctx, AV_LOG_ERROR, "pps_cb_qp_offset out of range: %d\n",
int16_t width, height;
uint32_t frame_num; ///< current frame number (zero-based)
- uint32_t data_size; ///< size of the frame data in bytes
+ int data_size; ///< size of the frame data in bytes
uint16_t frame_flags; ///< frame properties
uint8_t cb_offset; ///< needed for selecting VQ tables
uint8_t buf_sel; ///< active frame buffer: 0 - primary, 1 -secondary
GetByteContext gb;
const uint8_t *bs_hdr;
uint32_t frame_num, word2, check_sum, data_size;
- uint32_t y_offset, u_offset, v_offset, starts[3], ends[3];
+ int y_offset, u_offset, v_offset;
+ uint32_t starts[3], ends[3];
uint16_t height, width;
int i, j;
ctx->y_data_size = ends[0] - starts[0];
ctx->v_data_size = ends[1] - starts[1];
ctx->u_data_size = ends[2] - starts[2];
- if (FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
+ if (FFMIN3(y_offset, v_offset, u_offset) < 0 ||
+ FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
FFMIN3(y_offset, v_offset, u_offset) < gb.buffer - bs_hdr + 16 ||
FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) {
av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");
{
JvContext *s = avctx->priv_data;
+ if (!avctx->width || !avctx->height ||
+ (avctx->width & 7) || (avctx->height & 7)) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n",
+ avctx->width, avctx->height);
+ return AVERROR(EINVAL);
+ }
+
s->frame = av_frame_alloc();
if (!s->frame)
return AVERROR(ENOMEM);
avctx->pix_fmt = AV_PIX_FMT_PAL8;
+ if (!avctx->width || !avctx->height ||
+ (avctx->width & 1) || (avctx->height & 1)) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n",
+ avctx->width, avctx->height);
+ return AVERROR(EINVAL);
+ }
+
s->frame = av_frame_alloc();
if (!s->frame)
return AVERROR(ENOMEM);
#include "compat/os2threads.h"
#endif
+#include "libavutil/ffversion.h"
+const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
+
#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS
static int default_lockmgr_cb(void **arg, enum AVLockOp op)
{
slice_height = ((((slice + 1) * height) / slices) & cmask) -
slice_start;
+ if (!slice_height)
+ continue;
bsrc = src + slice_start * stride;
// first line - left neighbour prediction
slice_height = ((((slice + 1) * height) / slices) & cmask) -
slice_start;
slice_height >>= 1;
+ if (!slice_height)
+ continue;
bsrc = src + slice_start * stride;
ofs += slen;
bytestream2_skip(&gb, len);
} else {
+ if (ofs + len > frame_width ||
+ bytestream2_get_bytes_left(&gb) < len)
+ return AVERROR_INVALIDDATA;
bytestream2_get_buffer(&gb, &dp[ofs], len);
ofs += len;
}
* X-Face common data and utilities definition.
*/
+#include "libavutil/avassert.h"
+
#include "xface.h"
void ff_big_add(BigInt *b, uint8_t a)
c >>= XFACE_BITSPERWORD;
}
if (i == b->nb_words && c) {
+ av_assert0(b->nb_words < XFACE_MAX_WORDS);
b->nb_words++;
*w = c & XFACE_WORDMASK;
}
return;
if (a == 0) {
/* treat this as a == WORDCARRY and just shift everything left a WORD */
+ av_assert0(b->nb_words < XFACE_MAX_WORDS);
i = b->nb_words++;
w = b->words + i;
while (i--) {
c >>= XFACE_BITSPERWORD;
}
if (c) {
+ av_assert0(b->nb_words < XFACE_MAX_WORDS);
b->nb_words++;
*w = c & XFACE_WORDMASK;
}
/*
* Image is encoded as a big integer, using characters from '~' to
* '!', for a total of 94 symbols. In order to express
- * 48x48*2=8*XFACE_MAX_WORDS=4608
- * bits, we need a total of 704 digits, as given by:
- * ceil(lg_94(2^4608)) = 704
+ * 48x48 pixels with the worst case encoding 666 symbols should
+ * be sufficient.
*/
-#define XFACE_MAX_DIGITS 704
+#define XFACE_MAX_DIGITS 666
#define XFACE_BITSPERWORD 8
#define XFACE_WORDCARRY (1 << XFACE_BITSPERWORD)
#define XFACE_WORDMASK (XFACE_WORDCARRY - 1)
-#define XFACE_MAX_WORDS ((XFACE_PIXELS * 2 + XFACE_BITSPERWORD - 1) / XFACE_BITSPERWORD)
+// This must be larger or equal to log256(94^XFACE_MAX_DIGITS)
+#define XFACE_MAX_WORDS 546
/* Portable, very large unsigned integer arithmetic is needed.
* Implementation uses arrays of WORDs. */
#include "avdevice.h"
#include "config.h"
+#include "libavutil/ffversion.h"
+const char av_device_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
+
#define E AV_OPT_FLAG_ENCODING_PARAM
#define D AV_OPT_FLAG_DECODING_PARAM
#define A AV_OPT_FLAG_AUDIO_PARAM
#include "formats.h"
#include "internal.h"
+#include "libavutil/ffversion.h"
+const char av_filter_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
+
static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame);
void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
return 0;
default:
{
- char tag_buf[5];
+ char tag_buf[32];
av_get_codec_tag_string(tag_buf, sizeof(tag_buf), tag);
avpriv_request_sample(s, "In-stream tag=%s (0x%08X) len=%"PRIu32, tag_buf, tag, len);
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
{
- av_free(st->codec->extradata);
+ av_freep(&st->codec->extradata);
if (ff_get_extradata(st->codec, s->pb, size) < 0)
return AVERROR(ENOMEM);
return 0;
if (os->ctx && os->ctx_inited)
av_write_trailer(os->ctx);
if (os->ctx && os->ctx->pb)
- av_free(os->ctx->pb);
+ av_freep(&os->ctx->pb);
if (os->ctx)
avformat_free_context(os->ctx);
- av_free(os->metadata);
+ av_freep(&os->metadata);
for (j = 0; j < os->nb_extra_packets; j++)
- av_free(os->extra_packets[j]);
+ av_freep(&os->extra_packets[j]);
for (j = 0; j < os->nb_fragments; j++)
- av_free(os->fragments[j]);
- av_free(os->fragments);
+ av_freep(&os->fragments[j]);
+ av_freep(&os->fragments);
}
av_freep(&c->streams);
}
if (remove > 0) {
for (i = 0; i < remove; i++) {
unlink(os->fragments[i]->file);
- av_free(os->fragments[i]);
+ av_freep(&os->fragments[i]);
}
os->nb_fragments -= remove;
memmove(os->fragments, os->fragments + remove,
int has_looked_for_mfra;
MOVFragmentIndex** fragment_index_data;
unsigned fragment_index_count;
+ int atom_depth;
} MOVContext;
int ff_mp4_read_descr_len(AVIOContext *pb);
static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb,
AVStream *st, MOVStreamContext *sc,
- int size)
+ int64_t size)
{
// ttxt stsd contains display flags, justification, background
// color, fonts, and default styles, so fake an atom to read it
static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
AVStream *st, MOVStreamContext *sc,
- int size)
+ int64_t size)
{
if (st->codec->codec_tag == MKTAG('t','m','c','d')) {
- if (ff_get_extradata(st->codec, pb, size) < 0)
+ if ((int)size != size || ff_get_extradata(st->codec, pb, size) < 0)
return AVERROR(ENOMEM);
if (size > 16) {
MOVStreamContext *tmcd_ctx = st->priv_data;
MOVAtom a;
int i;
+ if (c->atom_depth > 10) {
+ av_log(c->fc, AV_LOG_ERROR, "Atoms too deeply nested\n");
+ return AVERROR_INVALIDDATA;
+ }
+ c->atom_depth ++;
+
if (atom.size < 0)
atom.size = INT64_MAX;
while (total_size + 8 <= atom.size && !avio_feof(pb)) {
{
av_log(c->fc, AV_LOG_ERROR, "Broken file, trak/mdat not at top-level\n");
avio_skip(pb, -8);
+ c->atom_depth --;
return 0;
}
}
int64_t start_pos = avio_tell(pb);
int64_t left;
int err = parse(c, pb, a);
- if (err < 0)
+ if (err < 0) {
+ c->atom_depth --;
return err;
+ }
if (c->found_moov && c->found_mdat &&
((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) ||
start_pos + a.size == avio_size(pb))) {
if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX)
c->next_root_atom = start_pos + a.size;
+ c->atom_depth --;
return 0;
}
left = a.size - avio_tell(pb) + start_pos;
if (total_size < atom.size && atom.size < 0x7ffff)
avio_skip(pb, atom.size - total_size);
+ c->atom_depth --;
return 0;
}
codec->codec_tag = avio_rl32(pb);
codec->codec_id = ff_codec_get_id(rsd_tags, codec->codec_tag);
if (!codec->codec_id) {
- char tag_buf[5];
+ char tag_buf[32];
av_get_codec_tag_string(tag_buf, sizeof(tag_buf), codec->codec_tag);
for (i=0; i < FF_ARRAY_ELEMS(rsd_unsupported_tags); i++) {
#include "riff.h"
#include "url.h"
+#include "libavutil/ffversion.h"
+const char av_format_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
+
/**
* @file
* various utility functions for use within FFmpeg
* various utility functions
*/
+#include "libavutil/ffversion.h"
+const char av_util_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
+
unsigned avutil_version(void)
{
static int checks_done;
#include "postprocess_internal.h"
#include "libavutil/avstring.h"
+#include "libavutil/ffversion.h"
+const char postproc_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
+
unsigned postproc_version(void)
{
av_assert0(LIBPOSTPROC_VERSION_MICRO >= 100);
#define ALIGN 32
+#include "libavutil/ffversion.h"
+const char swr_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
+
unsigned swresample_version(void)
{
av_assert0(LIBSWRESAMPLE_VERSION_MICRO >= 100);
#define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
-#define YUVRGB_TABLE_HEADROOM 128
+#define YUVRGB_TABLE_HEADROOM 256
#define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE