summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-23 01:49:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-23 05:13:56 +0200
commitf97faf67510d92c2a18180a6ec80435d5dd1da0b (patch)
treeb63cb9b8a5fc5bafa6963c07c712dbbdf419a175 /libavcodec
parent9e8dff90efa3faae5ac07fa5fae7e154367e24fd (diff)
parente71ebb19722bd2b46831d0ec311b757a56340617 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: id3v2: fix doxy comment - 'machine byte order' makes no sense on char arrays VC1: restore mistakenly removed code twinvq: check output buffer size before decoding twinvq: return an error when the packet size is too small lavf: export some forgotten symbols with non-av prefixes. swscale: update altivec yuv2planeX asm to new per-plane API. swscale: make yuv2yuvX_10_sse2/avx 8/9/16-bits aware. yuv2planeX10 SIMD swscale: decide whether to use yuv2plane1/X on a per-plane basis. swscale: reintroduce full precision in 16-bit output. Split up yuv2yuvX functions Split out yuv2yuv1 luma and chroma in order to make them generic DSP functions lavc: replace references to deprecated AVCodecContext.error_recognition to use AVCodecContext.err_recognition lavc: translate non-flag-based er options into flag-based ef options at codec open add -err_filter AVOptions to access flag-based error recognition h264_weight: initialize "height" function argument properly. presets: spelling error in libvpx 1080p50_60 avplay: fix fullscreen behaviour with SDL 1.2.14 on Mac OS X Conflicts: ffplay.c libavformat/libavformat.v libswscale/swscale.c libswscale/x86/swscale_template.c tests/ref/lavfi/pixfmts_scale Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aacdec.c2
-rw-r--r--libavcodec/ac3dec.c2
-rw-r--r--libavcodec/alsdec.c6
-rw-r--r--libavcodec/h261dec.c2
-rw-r--r--libavcodec/h263dec.c2
-rw-r--r--libavcodec/h264.c4
-rw-r--r--libavcodec/h264_refs.c2
-rw-r--r--libavcodec/mjpegbdec.c4
-rw-r--r--libavcodec/mjpegdec.c2
-rw-r--r--libavcodec/mpeg12.c26
-rw-r--r--libavcodec/mpegaudiodec.c10
-rw-r--r--libavcodec/mxpegdec.c4
-rw-r--r--libavcodec/options.c9
-rw-r--r--libavcodec/twinvq.c14
-rw-r--r--libavcodec/utils.c10
-rw-r--r--libavcodec/vc1dec.c4
-rw-r--r--libavcodec/x86/h264_weight_10bit.asm1
17 files changed, 65 insertions, 39 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 97fddfc95c..97d187c2a2 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -596,7 +596,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
int ret = set_default_channel_config(avctx, new_che_pos, ac->m4ac.chan_config);
if (!ret)
output_configure(ac, ac->che_pos, new_che_pos, ac->m4ac.chan_config, OC_GLOBAL_HDR);
- else if (avctx->error_recognition >= FF_ER_EXPLODE)
+ else if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
}
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 84a469193e..09b9a3102c 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1359,7 +1359,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
if (s->frame_size > buf_size) {
av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
err = AAC_AC3_PARSE_ERROR_FRAME_SIZE;
- } else if (avctx->error_recognition >= FF_ER_CAREFUL) {
+ } else if (avctx->err_recognition & AV_EF_CRCCHECK) {
/* check for crc mismatch */
if (av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2], s->frame_size-2)) {
av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 661f264cbf..d1055266d4 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -393,7 +393,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
if (get_bits_left(&gb) < 32)
return -1;
- if (avctx->error_recognition >= FF_ER_CAREFUL) {
+ if (avctx->err_recognition & AV_EF_CRCCHECK) {
ctx->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
ctx->crc = 0xFFFFFFFF;
ctx->crc_org = ~get_bits_long(&gb, 32);
@@ -1476,7 +1476,7 @@ static int decode_frame(AVCodecContext *avctx,
}
// update CRC
- if (sconf->crc_enabled && avctx->error_recognition >= FF_ER_CAREFUL) {
+ if (sconf->crc_enabled && (avctx->err_recognition & AV_EF_CRCCHECK)) {
int swap = HAVE_BIGENDIAN != sconf->msb_first;
if (ctx->avctx->bits_per_raw_sample == 24) {
@@ -1710,7 +1710,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
// allocate crc buffer
if (HAVE_BIGENDIAN != sconf->msb_first && sconf->crc_enabled &&
- avctx->error_recognition >= FF_ER_CAREFUL) {
+ (avctx->err_recognition & AV_EF_CRCCHECK)) {
ctx->crc_buffer = av_malloc(sizeof(*ctx->crc_buffer) *
ctx->cur_frame_length *
avctx->channels *
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 96ebb24027..17abc64a60 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -136,7 +136,7 @@ static int h261_decode_gob_header(H261Context *h){
if(s->qscale==0) {
av_log(s->avctx, AV_LOG_ERROR, "qscale has forbidden 0 value\n");
- if (s->avctx->error_recognition >= FF_ER_COMPLIANT)
+ if (s->avctx->err_recognition & AV_EF_BITSTREAM)
return -1;
}
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 2887805a0e..dfb055b930 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -732,7 +732,7 @@ intrax8_decoded:
av_log(avctx, AV_LOG_DEBUG, "%"PRId64"\n", rdtsc()-time);
#endif
- return (ret && avctx->error_recognition >= FF_ER_EXPLODE)?ret:get_consumed_bytes(s, buf_size);
+ return (ret && (avctx->err_recognition & AV_EF_EXPLODE))?ret:get_consumed_bytes(s, buf_size);
}
AVCodec ff_h263_decoder = {
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 4906f92ea8..5f8b7925a4 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2893,7 +2893,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
ff_thread_report_progress((AVFrame*)s->current_picture_ptr, INT_MAX, 1);
ff_generate_sliding_window_mmcos(h);
if (ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index) < 0 &&
- s->avctx->error_recognition >= FF_ER_EXPLODE)
+ (s->avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
/* Error concealment: if a ref is missing, copy the previous ref in its place.
* FIXME: avoiding a memcpy would be nice, but ref handling makes many assumptions
@@ -3072,7 +3072,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
}
if(h->nal_ref_idc && ff_h264_decode_ref_pic_marking(h0, &s->gb) < 0 &&
- s->avctx->error_recognition >= FF_ER_EXPLODE)
+ (s->avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
if(FRAME_MBAFF){
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 0e00c4f94b..ddfacd61d4 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -654,7 +654,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
print_short_term(h);
print_long_term(h);
- return h->s.avctx->error_recognition >= FF_ER_EXPLODE ? err : 0;
+ return (h->s.avctx->err_recognition & AV_EF_EXPLODE) ? err : 0;
}
int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb){
diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index ff39f71fd7..75f3d50b76 100644
--- a/libavcodec/mjpegbdec.c
+++ b/libavcodec/mjpegbdec.c
@@ -82,7 +82,7 @@ read_header:
init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - (buf_ptr+dqt_offs))*8);
s->start_code = DQT;
if (ff_mjpeg_decode_dqt(s) < 0 &&
- avctx->error_recognition >= FF_ER_EXPLODE)
+ (avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
}
@@ -116,7 +116,7 @@ read_header:
s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
s->start_code = SOS;
if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 &&
- avctx->error_recognition >= FF_ER_EXPLODE)
+ (avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
}
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 944b2eb975..9beb4649b5 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1522,7 +1522,7 @@ eoi_parser:
break;
}
if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 &&
- avctx->error_recognition >= FF_ER_EXPLODE)
+ (avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
break;
case DRI:
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 9663db2f61..7d469530d0 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1378,7 +1378,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_B) {
s->full_pel[0] = get_bits1(&s->gb);
f_code = get_bits(&s->gb, 3);
- if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
+ if (f_code == 0 && (avctx->err_recognition & AV_EF_BITSTREAM))
return -1;
s->mpeg_f_code[0][0] = f_code;
s->mpeg_f_code[0][1] = f_code;
@@ -1386,7 +1386,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
if (s->pict_type == AV_PICTURE_TYPE_B) {
s->full_pel[1] = get_bits1(&s->gb);
f_code = get_bits(&s->gb, 3);
- if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
+ if (f_code == 0 && (avctx->err_recognition & AV_EF_BITSTREAM))
return -1;
s->mpeg_f_code[1][0] = f_code;
s->mpeg_f_code[1][1] = f_code;
@@ -1819,7 +1819,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
&& s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/;
if (left < 0 || (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10)
- || (avctx->error_recognition >= FF_ER_AGGRESSIVE && left > 8)) {
+ || ((avctx->err_recognition & AV_EF_BUFFER) && left > 8)) {
av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n", left, show_bits(&s->gb, FFMIN(left, 23)));
return -1;
} else
@@ -1911,7 +1911,7 @@ static int slice_decode_thread(AVCodecContext *c, void *arg)
//av_log(c, AV_LOG_DEBUG, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
//ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, s->start_mb_y, s->end_mb_y, s->error_count);
if (ret < 0) {
- if (c->error_recognition >= FF_ER_EXPLODE)
+ if (c->err_recognition & AV_EF_EXPLODE)
return ret;
if (s->resync_mb_x >= 0 && s->resync_mb_y >= 0)
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, AC_ERROR | DC_ERROR | MV_ERROR);
@@ -1999,7 +1999,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
s->aspect_ratio_info = get_bits(&s->gb, 4);
if (s->aspect_ratio_info == 0) {
av_log(avctx, AV_LOG_ERROR, "aspect ratio has forbidden 0 value\n");
- if (avctx->error_recognition >= FF_ER_COMPLIANT)
+ if (avctx->err_recognition & AV_EF_BITSTREAM)
return -1;
}
s->frame_rate_index = get_bits(&s->gb, 4);
@@ -2287,7 +2287,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
if (avctx->extradata && !avctx->frame_number) {
int ret = decode_chunks(avctx, picture, data_size, avctx->extradata, avctx->extradata_size);
- if (ret < 0 && avctx->error_recognition >= FF_ER_EXPLODE)
+ if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return ret;
}
@@ -2347,7 +2347,7 @@ static int decode_chunks(AVCodecContext *avctx,
s->sync=1;
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring SEQ_START_CODE after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2381,7 +2381,7 @@ static int decode_chunks(AVCodecContext *avctx,
last_code = PICTURE_START_CODE;
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring pic after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2394,7 +2394,7 @@ static int decode_chunks(AVCodecContext *avctx,
mpeg_decode_sequence_extension(s);
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring seq ext after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2412,7 +2412,7 @@ static int decode_chunks(AVCodecContext *avctx,
mpeg_decode_picture_coding_extension(s);
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring pic cod ext after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2428,7 +2428,7 @@ static int decode_chunks(AVCodecContext *avctx,
s->sync=1;
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring GOP_START_CODE after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2475,7 +2475,7 @@ static int decode_chunks(AVCodecContext *avctx,
if (!s2->pict_type) {
av_log(avctx, AV_LOG_ERROR, "Missing picture start code\n");
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
break;
}
@@ -2516,7 +2516,7 @@ static int decode_chunks(AVCodecContext *avctx,
emms_c();
if (ret < 0) {
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return ret;
if (s2->resync_mb_x >= 0 && s2->resync_mb_y >= 0)
ff_er_add_slice(s2, s2->resync_mb_x, s2->resync_mb_y, s2->mb_x, s2->mb_y, AC_ERROR | DC_ERROR | MV_ERROR);
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index f5f169a8e3..286e08f27a 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -79,7 +79,7 @@ typedef struct MPADecodeContext {
#endif
int adu_mode; ///< 0 for standard mp3, 1 for adu formatted mp3
int dither_state;
- int error_recognition;
+ int err_recognition;
AVCodecContext* avctx;
MPADSPContext mpadsp;
} MPADecodeContext;
@@ -280,7 +280,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
ff_mpadsp_init(&s->mpadsp);
avctx->sample_fmt= OUT_FMT;
- s->error_recognition= avctx->error_recognition;
+ s->err_recognition = avctx->err_recognition;
if (!init && !avctx->parse_only) {
int offset;
@@ -1104,7 +1104,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
s_index -= 4;
skip_bits_long(&s->gb, last_pos - pos);
av_log(s->avctx, AV_LOG_INFO, "overread, skip %d enddists: %d %d\n", last_pos - pos, end_pos-pos, end_pos2-pos);
- if(s->error_recognition >= FF_ER_COMPLIANT)
+ if(s->err_recognition & AV_EF_BITSTREAM)
s_index=0;
break;
}
@@ -1134,10 +1134,10 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
/* skip extension bits */
bits_left = end_pos2 - get_bits_count(&s->gb);
//av_log(NULL, AV_LOG_ERROR, "left:%d buf:%p\n", bits_left, s->in_gb.buffer);
- if (bits_left < 0 && s->error_recognition >= FF_ER_COMPLIANT) {
+ if (bits_left < 0 && (s->err_recognition & AV_EF_BITSTREAM)) {
av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
s_index=0;
- }else if(bits_left > 0 && s->error_recognition >= FF_ER_AGGRESSIVE){
+ }else if(bits_left > 0 && (s->err_recognition & AV_EF_BUFFER)){
av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
s_index=0;
}
diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
index 609440650b..9f9212ce9b 100644
--- a/libavcodec/mxpegdec.c
+++ b/libavcodec/mxpegdec.c
@@ -275,11 +275,11 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
}
ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, reference_ptr);
- if (ret < 0 && avctx->error_recognition >= FF_ER_EXPLODE)
+ if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return ret;
} else {
ret = ff_mjpeg_decode_sos(jpg, NULL, NULL);
- if (ret < 0 && avctx->error_recognition >= FF_ER_EXPLODE)
+ if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return ret;
}
diff --git a/libavcodec/options.c b/libavcodec/options.c
index d494efe12b..070d7e1cda 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -201,14 +201,19 @@ static const AVOption options[]={
{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, V|D|E, "strict"},
{"experimental", "allow non standardized experimental things", 0, AV_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, V|D|E, "strict"},
{"b_qoffset", "qp offset between P and B frames", OFFSET(b_quant_offset), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E},
+#if FF_API_ER
{"er", "set error detection aggressivity", OFFSET(error_recognition), AV_OPT_TYPE_INT, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, A|V|D, "er"},
{"careful", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, V|D, "er"},
{"compliant", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_COMPLIANT }, INT_MIN, INT_MAX, V|D, "er"},
{"aggressive", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"},
-#if FF_API_ER
{"very_aggressive", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_VERY_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"},
-#endif /* FF_API_ER */
{"explode", "abort decoding on error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, V|D, "er"},
+#endif /* FF_API_ER */
+{"err_filter", "set error detection filter flags", OFFSET(err_recognition), AV_OPT_TYPE_FLAGS, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, A|V|D, "err_filter"},
+{"crccheck", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, V|D, "err_filter"},
+{"bitstream", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, V|D, "err_filter"},
+{"buffer", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BUFFER }, INT_MIN, INT_MAX, V|D, "err_filter"},
+{"explode", "abort decoding on minor error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_EXPLODE }, INT_MIN, INT_MAX, V|D, "err_filter"},
{"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"parse_only", NULL, OFFSET(parse_only), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c
index 17c268dad1..2ce7b306fc 100644
--- a/libavcodec/twinvq.c
+++ b/libavcodec/twinvq.c
@@ -822,7 +822,7 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data,
const ModeTab *mtab = tctx->mtab;
float *out = data;
enum FrameType ftype;
- int window_type;
+ int window_type, out_size;
static const enum FrameType wtype_to_ftype_table[] = {
FT_LONG, FT_LONG, FT_SHORT, FT_LONG,
FT_MEDIUM, FT_LONG, FT_LONG, FT_MEDIUM, FT_MEDIUM
@@ -831,8 +831,14 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data,
if (buf_size*8 < avctx->bit_rate*mtab->size/avctx->sample_rate + 8) {
av_log(avctx, AV_LOG_ERROR,
"Frame too small (%d bytes). Truncated file?\n", buf_size);
- *data_size = 0;
- return buf_size;
+ return AVERROR(EINVAL);
+ }
+
+ out_size = mtab->size * avctx->channels *
+ av_get_bytes_per_sample(avctx->sample_fmt);
+ if (*data_size < out_size) {
+ av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n");
+ return AVERROR(EINVAL);
}
init_get_bits(&gb, buf, buf_size * 8);
@@ -857,7 +863,7 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data,
return buf_size;
}
- *data_size = mtab->size*avctx->channels*4;
+ *data_size = out_size;
return buf_size;
}
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 405fc31318..06d375d815 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -610,6 +610,16 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
goto free_and_end;
}
avctx->frame_number = 0;
+#if FF_API_ER
+
+ av_log(avctx, AV_LOG_DEBUG, "err{or,}_recognition separate: %d; %d\n",
+ avctx->error_recognition, avctx->err_recognition);
+ /* FF_ER_CAREFUL (==1) implies AV_EF_CRCCHECK (== 1<<1 - 1),
+ FF_ER_COMPLIANT (==2) implies AV_EF_{CRCCHECK,BITSTREAM} (== 1<<2 - 1), et cetera} */
+ avctx->err_recognition |= (1<<(avctx->error_recognition-(avctx->error_recognition>=FF_ER_VERY_AGGRESSIVE))) - 1;
+ av_log(avctx, AV_LOG_DEBUG, "err{or,}_recognition combined: %d; %d\n",
+ avctx->error_recognition, avctx->err_recognition);
+#endif
if (!HAVE_THREADS)
av_log(avctx, AV_LOG_WARNING, "Warning: not compiled with thread support, using thread emulation\n");
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 69fd5be7be..8384771ad9 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -930,6 +930,8 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
if (!v->field_mode || (v->field_mode && !v->numref)) {
valid_count = get_chroma_mv(mvx, mvy, intra, 0, &tx, &ty);
if (!valid_count) {
+ s->current_picture.f.motion_val[1][s->block_index[0]][0] = 0;
+ s->current_picture.f.motion_val[1][s->block_index[0]][1] = 0;
v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0;
return; //no need to do MC for intra blocks
}
@@ -941,6 +943,8 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
if (dominant)
chroma_ref_type = !v->cur_field_type;
}
+ s->current_picture.f.motion_val[1][s->block_index[0]][0] = tx;
+ s->current_picture.f.motion_val[1][s->block_index[0]][1] = ty;
uvmx = (tx + ((tx & 3) == 3)) >> 1;
uvmy = (ty + ((ty & 3) == 3)) >> 1;
diff --git a/libavcodec/x86/h264_weight_10bit.asm b/libavcodec/x86/h264_weight_10bit.asm
index 20df6fbab5..9c4b276e49 100644
--- a/libavcodec/x86/h264_weight_10bit.asm
+++ b/libavcodec/x86/h264_weight_10bit.asm
@@ -44,6 +44,7 @@ SECTION .text
PROLOGUE 0,6,8
movifnidn r0, r0mp
movifnidn r1d, r1m
+ movifnidn r2d, r2m
movifnidn r4d, r4m
movifnidn r5d, r5m
%endmacro