diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-25 23:35:30 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-25 23:35:30 +0200 |
commit | c6a4397410ab5f1b22cbc9f1ccb3126b3e5d6125 (patch) | |
tree | c454ad645169a69a422cae0f1fa30f9188c50d7c /libavcodec | |
parent | 210a437e105fbd92f1dd9c2c82f4a5efd80ca8fd (diff) | |
parent | 37e69e2dee7c5167083bb42d669f73f038111a79 (diff) | |
download | ffmpeg-c6a4397410ab5f1b22cbc9f1ccb3126b3e5d6125.tar.gz |
Merge commit '37e69e2dee7c5167083bb42d669f73f038111a79' into release/0.10
* commit '37e69e2dee7c5167083bb42d669f73f038111a79':
ac3: Clean up the error paths
ac3: Do not clash with normal AVERROR
dxa: Make sure the reference frame exists
h261: check the mtype index
segafilm: Error out on impossible packet size
ogg: Always alloc the private context in vorbis_header
vc1: check mb_height validity.
Conflicts:
libavcodec/h261dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aac_ac3_parser.h | 14 | ||||
-rw-r--r-- | libavcodec/ac3dec.c | 9 | ||||
-rw-r--r-- | libavcodec/dxa.c | 6 | ||||
-rw-r--r-- | libavcodec/h261dec.c | 3 | ||||
-rw-r--r-- | libavcodec/vc1dec.c | 6 |
5 files changed, 27 insertions, 11 deletions
diff --git a/libavcodec/aac_ac3_parser.h b/libavcodec/aac_ac3_parser.h index b1fb0cf59f..517a40246e 100644 --- a/libavcodec/aac_ac3_parser.h +++ b/libavcodec/aac_ac3_parser.h @@ -28,13 +28,13 @@ #include "parser.h" typedef enum { - AAC_AC3_PARSE_ERROR_SYNC = -1, - AAC_AC3_PARSE_ERROR_BSID = -2, - AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -3, - AAC_AC3_PARSE_ERROR_FRAME_SIZE = -4, - AAC_AC3_PARSE_ERROR_FRAME_TYPE = -5, - AAC_AC3_PARSE_ERROR_CRC = -6, - AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -7, + AAC_AC3_PARSE_ERROR_SYNC = -0x1030c0a, + AAC_AC3_PARSE_ERROR_BSID = -0x2030c0a, + AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a, + AAC_AC3_PARSE_ERROR_FRAME_SIZE = -0x4030c0a, + AAC_AC3_PARSE_ERROR_FRAME_TYPE = -0x5030c0a, + AAC_AC3_PARSE_ERROR_CRC = -0x6030c0a, + AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -0x7030c0a, } AACAC3ParseError; typedef struct AACAC3ParseContext { diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index c11df7f9d0..ffcfd3bb6b 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1342,7 +1342,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, /* skip frame if CRC is ok. otherwise use error concealment. */ /* TODO: add support for substreams and dependent frames */ if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT || s->substreamid) { - av_log(avctx, AV_LOG_ERROR, "unsupported frame type : " + av_log(avctx, AV_LOG_WARNING, "unsupported frame type : " "skipping frame\n"); *got_frame_ptr = 0; return buf_size; @@ -1350,9 +1350,12 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, av_log(avctx, AV_LOG_ERROR, "invalid frame type\n"); } break; - default: - av_log(avctx, AV_LOG_ERROR, "invalid header\n"); + case AAC_AC3_PARSE_ERROR_CRC: + case AAC_AC3_PARSE_ERROR_CHANNEL_CFG: break; + default: // Normal AVERROR do not try to recover. + *got_frame_ptr = 0; + return err; } } else { /* check that reported frame size fits in input buffer */ diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index f32fdd33e5..20f5464e8a 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -255,6 +255,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac case 5: c->pic.key_frame = !(compr & 1); c->pic.pict_type = (compr & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; + + if (!tmpptr && !c->pic.key_frame) { + av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n"); + return AVERROR_INVALIDDATA; + } + for(j = 0; j < avctx->height; j++){ if(compr & 1){ for(i = 0; i < avctx->width; i++) diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index bd7a368ace..e7dc925248 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -287,7 +287,8 @@ static int h261_decode_mb(H261Context *h){ // Read mtype h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2); if (h->mtype < 0) { - av_log(s->avctx, AV_LOG_ERROR, "illegal mtype %d\n", h->mtype); + av_log(s->avctx, AV_LOG_ERROR, "Invalid mtype index %d\n", + h->mtype); return SLICE_ERROR; } h->mtype = h261_mtype_map[h->mtype]; diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index d2f099871d..ee792cdbf8 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5584,6 +5584,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, v->mv_f[1] = tmp[1]; } mb_height = s->mb_height >> v->field_mode; + + if (!mb_height) { + av_log(v->s.avctx, AV_LOG_ERROR, "Invalid mb_height.\n"); + goto err; + } + for (i = 0; i <= n_slices; i++) { if (i > 0 && slices[i - 1].mby_start >= mb_height) { if (v->field_mode <= 0) { |