aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-17 02:08:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-17 02:20:20 +0100
commitc961ce969a613e08c720cb6aa3cce4bd81cefe3f (patch)
tree2ec5c1ed47aae83f32f455c08a7d947c659498c0
parent52cea9ce9209bf4ee0af6475b7db880e962cb924 (diff)
parenta335ffd7f4cdaaa6a8fe4187f6f06b0418eea19a (diff)
downloadffmpeg-c961ce969a613e08c720cb6aa3cce4bd81cefe3f.tar.gz
Merge commit 'a335ffd7f4cdaaa6a8fe4187f6f06b0418eea19a' into release/0.10
* commit 'a335ffd7f4cdaaa6a8fe4187f6f06b0418eea19a': h264: fix sps parsing for SVC and CAVLC 4:4:4 Intra profiles h264: check sps.log2_max_frame_num for validity h264: slice-mt: get last_pic_dropable from master context ppc: always use pic for shared libraries h264: error out on unset current_picture_ptr for h->current_slice > 0 flashsv: make sure data for zlib priming is available h264: enable low delay only if no delayed frames were seen flashsv: check for keyframe before using differential coding lavf: avoid integer overflow in ff_compute_frame_duration() aacdec: Fix an off-by-one overwrite when switching to LTP profile from MAIN. APIchanges: Fill in missing commit hashes Conflicts: doc/APIchanges Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rwxr-xr-xconfigure2
-rw-r--r--doc/APIchanges8
-rw-r--r--libavcodec/aacdec.c2
-rw-r--r--libavcodec/flashsv.c10
-rw-r--r--libavcodec/h264.c18
-rw-r--r--libavcodec/h264_ps.c22
-rw-r--r--libavformat/utils.c5
7 files changed, 54 insertions, 13 deletions
diff --git a/configure b/configure
index e307fd3a7a..2a8d0a7806 100755
--- a/configure
+++ b/configure
@@ -2560,7 +2560,7 @@ check_host_cflags -std=c99
check_host_cflags -Wall
case "$arch" in
- alpha|ia64|mips|parisc|sparc)
+ alpha|ia64|mips|parisc|ppc|sparc)
spic=$shared
;;
x86)
diff --git a/doc/APIchanges b/doc/APIchanges
index ed13f21bd9..d387b5020b 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -22,17 +22,17 @@ API changes, most recent first:
muxers supporting it (av_write_frame makes sure it is called
only for muxers with this flag).
-2012-03-04 - xxxxxxx - lavu 51.22.1 - error.h
+2012-03-04 - 7f3f855 - lavu 51.22.1 - error.h
Add AVERROR_UNKNOWN
-2012-02-29 - xxxxxxx - lavf 53.21.1
+2012-02-29 - 2ad77c6 - lavf 53.21.1
Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
-2012-02-29 - xxxxxxx - lavu 51.22.0 - intfloat.h
+2012-02-29 - a1556d3 - lavu 51.22.0 - intfloat.h
Add a new installed header libavutil/intfloat.h with int/float punning
functions.
-2012-02-17 - xxxxxxx - lavc 53.35.0
+2012-02-17 - 350d06d - lavc 53.35.0
Add avcodec_is_open() function.
2012-01-15 - lavc 53.34.0
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 5c6404e0a4..a592c50585 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -1766,7 +1766,7 @@ static void apply_tns(float coef[1024], TemporalNoiseShaping *tns,
int w, filt, m, i;
int bottom, top, order, start, end, size, inc;
float lpc[TNS_MAX_ORDER];
- float tmp[TNS_MAX_ORDER];
+ float tmp[TNS_MAX_ORDER + 1];
for (w = 0; w < ics->num_windows; w++) {
bottom = ics->num_swb;
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index 3f9ec35fd3..b7ace4f884 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -381,6 +381,11 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
}
if (has_diff) {
+ if (!s->keyframe) {
+ av_log(avctx, AV_LOG_ERROR,
+ "inter frame without keyframe\n");
+ return AVERROR_INVALIDDATA;
+ }
s->diff_start = get_bits(&gb, 8);
s->diff_height = get_bits(&gb, 8);
av_log(avctx, AV_LOG_DEBUG,
@@ -400,6 +405,11 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
av_log_missing_feature(avctx, "zlibprime_curr", 1);
return AVERROR_PATCHWELCOME;
}
+ if (!s->blocks && (s->zlibprime_curr || s->zlibprime_prev)) {
+ av_log(avctx, AV_LOG_ERROR, "no data available for zlib "
+ "priming\n");
+ return AVERROR_INVALIDDATA;
+ }
size--; // account for flags byte
}
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 1630235ee0..90876c3778 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2895,6 +2895,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
s->picture_structure = last_pic_structure;
s->dropable = last_pic_dropable;
return AVERROR_INVALIDDATA;
+ } else if (!s0->current_picture_ptr) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "unset current_picture_ptr on %d. slice\n",
+ h0->current_slice + 1);
+ return AVERROR_INVALIDDATA;
}
} else {
/* Shorten frame num gaps so we don't have to allocate reference
@@ -4062,9 +4067,16 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
ff_h264_decode_seq_parameter_set(h);
}
- if (s->flags& CODEC_FLAG_LOW_DELAY ||
- (h->sps.bitstream_restriction_flag && !h->sps.num_reorder_frames))
- s->low_delay=1;
+ if (s->flags & CODEC_FLAG_LOW_DELAY ||
+ (h->sps.bitstream_restriction_flag &&
+ !h->sps.num_reorder_frames)) {
+ if (s->avctx->has_b_frames > 1 || h->delayed_pic[0])
+ av_log(avctx, AV_LOG_WARNING, "Delayed frames seen "
+ "reenabling low delay requires a codec "
+ "flush.\n");
+ else
+ s->low_delay = 1;
+ }
if(avctx->has_b_frames < 2)
avctx->has_b_frames= !s->low_delay;
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index e462287363..8c9b5167be 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -37,6 +37,9 @@
//#undef NDEBUG
#include <assert.h>
+#define MAX_LOG2_MAX_FRAME_NUM (12 + 4)
+#define MIN_LOG2_MAX_FRAME_NUM 4
+
static const AVRational pixel_aspect[17]={
{0, 1},
{1, 1},
@@ -315,7 +318,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
MpegEncContext * const s = &h->s;
int profile_idc, level_idc, constraint_set_flags = 0;
unsigned int sps_id;
- int i;
+ int i, log2_max_frame_num_minus4;
SPS *sps;
profile_idc= get_bits(&s->gb, 8);
@@ -346,7 +349,11 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
sps->scaling_matrix_present = 0;
sps->colorspace = 2; //AVCOL_SPC_UNSPECIFIED
- if(sps->profile_idc >= 100){ //high profile
+ if (sps->profile_idc == 100 || sps->profile_idc == 110 ||
+ sps->profile_idc == 122 || sps->profile_idc == 244 ||
+ sps->profile_idc == 44 || sps->profile_idc == 83 ||
+ sps->profile_idc == 86 || sps->profile_idc == 118 ||
+ sps->profile_idc == 128 || sps->profile_idc == 144) {
sps->chroma_format_idc= get_ue_golomb_31(&s->gb);
if (sps->chroma_format_idc > 3U) {
av_log(h->s.avctx, AV_LOG_ERROR, "chroma_format_idc %d is illegal\n", sps->chroma_format_idc);
@@ -369,7 +376,16 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
sps->bit_depth_chroma = 8;
}
- sps->log2_max_frame_num= get_ue_golomb(&s->gb) + 4;
+ log2_max_frame_num_minus4 = get_ue_golomb(&s->gb);
+ if (log2_max_frame_num_minus4 < MIN_LOG2_MAX_FRAME_NUM - 4 ||
+ log2_max_frame_num_minus4 > MAX_LOG2_MAX_FRAME_NUM - 4) {
+ av_log(h->s.avctx, AV_LOG_ERROR,
+ "log2_max_frame_num_minus4 out of range (0-12): %d\n",
+ log2_max_frame_num_minus4);
+ return AVERROR_INVALIDDATA;
+ }
+ sps->log2_max_frame_num = log2_max_frame_num_minus4 + 4;
+
sps->poc_type= get_ue_golomb_31(&s->gb);
if(sps->poc_type == 0){ //FIXME #define
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 25673a63c8..7e807c2333 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -902,7 +902,10 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st,
*pnum = st->codec->time_base.num;
*pden = st->codec->time_base.den;
if (pc && pc->repeat_pict) {
- *pnum = (*pnum) * (1 + pc->repeat_pict);
+ if (*pnum > INT_MAX / (1 + pc->repeat_pict))
+ *pden /= 1 + pc->repeat_pict;
+ else
+ *pnum *= 1 + pc->repeat_pict;
}
//If this codec can be interlaced or progressive then we need a parser to compute duration of a packet
//Thus if we have no parser in such case leave duration undefined.