Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-17 00:53:50 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-01-17 00:53:50 +0400
commit5339a9f000519851d111d747a9c582981be7ee82 (patch)
tree263715bdda7df2c5cad55d74d98a4d80b6779773 /libavcodec
parentbd953f94044eec49142d3d61993682f8b2186613 (diff)
parentb19eafa2b930ee40abfde6d1f026b7fa5591c4dc (diff)
Merge commit 'b19eafa2b930ee40abfde6d1f026b7fa5591c4dc' into release/0.10
* commit 'b19eafa2b930ee40abfde6d1f026b7fa5591c4dc': eacmv: Make sure a reference frame exists before referencing it mpeg4videodec: Check the width/height in mpeg4_decode_sprite_trajectory ivi_common: Make sure color planes have been initialized oggparseogm: Convert to use bytestream2 rv34: Check the return value from ff_rv34_decode_init matroskadec: Verify realaudio codec parameters mace: Make sure that the channel count is set to a valid value svq3: Check for any negative return value from ff_h264_check_intra_pred_mode vp3: Check the framerate for validity cavsdec: Make sure a sequence header has been decoded before decoding pictures sierravmd: Do sanity checking of frame sizes omadec: Properly check lengths before incrementing the position mpc8: Make sure the first stream exists before parsing the seek table Conflicts: libavcodec/eacmv.c libavcodec/mpeg4videodec.c libavformat/omadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/cavsdec.c5
-rw-r--r--libavcodec/eacmv.c4
-rw-r--r--libavcodec/ivi_common.c5
-rw-r--r--libavcodec/mace.c4
-rw-r--r--libavcodec/mpeg4videodec.c14
-rw-r--r--libavcodec/rv30.c4
-rw-r--r--libavcodec/rv40.c4
-rw-r--r--libavcodec/svq3.c6
-rw-r--r--libavcodec/vp3.c4
9 files changed, 34 insertions, 16 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 0b617061eb..221ead6d18 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -468,6 +468,11 @@ static int decode_pic(AVSContext *h) {
int skip_count = -1;
enum cavs_mb mb_type;
+ if (!h->top_qp) {
+ av_log(h, AV_LOG_ERROR, "No sequence header decoded yet\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (!s->context_initialized) {
s->avctx->idct_algo = FF_IDCT_CAVS;
if (MPV_common_init(s) < 0)
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index 8a8d6a9cef..d7b8562aca 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -112,8 +112,8 @@ static void cmv_decode_inter(CmvContext * s, const uint8_t *buf, const uint8_t *
int yoffset = ((buf[i] >> 4)) - 7;
if (s->last_frame.data[0])
cmv_motcomp(s->frame.data[0], s->frame.linesize[0],
- s->last_frame.data[0], s->last_frame.linesize[0],
- x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
+ s->last_frame.data[0], s->last_frame.linesize[0],
+ x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
}
i++;
}
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index ee16b2a28c..bd590af2f9 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -894,6 +894,11 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return AVERROR_PATCHWELCOME;
}
+ if (!ctx->planes[0].bands) {
+ av_log(avctx, AV_LOG_ERROR, "Color planes not initialized yet\n");
+ return AVERROR_INVALIDDATA;
+ }
+
ctx->switch_buffers(ctx);
//{ START_TIMER;
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index ffa11ad80d..fcd49d957f 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -231,8 +231,8 @@ static av_cold int mace_decode_init(AVCodecContext * avctx)
{
MACEContext *ctx = avctx->priv_data;
- if (avctx->channels > 2)
- return -1;
+ if (avctx->channels > 2 || avctx->channels < 1)
+ return AVERROR(EINVAL);
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
avcodec_get_frame_defaults(&ctx->frame);
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 140fce8297..859b04f552 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -160,7 +160,7 @@ static inline int mpeg4_is_resync(MpegEncContext *s){
return 0;
}
-static int mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)
+static int mpeg4_decode_sprite_trajectory(MpegEncContext *s, GetBitContext *gb)
{
int i;
int a= 2<<s->sprite_warping_accuracy;
@@ -176,8 +176,8 @@ static int mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)
int h= s->height;
int min_ab;
- if(w<=0 || h<=0)
- return -1;
+ if (w <= 0 || h <= 0)
+ return AVERROR_INVALIDDATA;
for(i=0; i<s->num_sprite_warping_points; i++){
int length;
@@ -415,8 +415,8 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s)
skip_bits(&s->gb, 3); /* intra dc vlc threshold */
//FIXME don't just ignore everything
if(s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
- if(mpeg4_decode_sprite_trajectory(s, &s->gb) < 0)
- return -1;
+ if (mpeg4_decode_sprite_trajectory(s, &s->gb) < 0)
+ return AVERROR_INVALIDDATA;
av_log(s->avctx, AV_LOG_ERROR, "untested\n");
}
@@ -2056,8 +2056,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
}
if(s->pict_type == AV_PICTURE_TYPE_S && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
- if(mpeg4_decode_sprite_trajectory(s, gb) < 0)
- return -1;
+ if (mpeg4_decode_sprite_trajectory(s, gb) < 0)
+ return AVERROR_INVALIDDATA;
if(s->sprite_brightness_change) av_log(s->avctx, AV_LOG_ERROR, "sprite_brightness_change not supported\n");
if(s->vol_sprite_usage==STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "static sprite not supported\n");
}
diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
index e60c93db4b..2a44363e4f 100644
--- a/libavcodec/rv30.c
+++ b/libavcodec/rv30.c
@@ -249,9 +249,11 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
static av_cold int rv30_decode_init(AVCodecContext *avctx)
{
RV34DecContext *r = avctx->priv_data;
+ int ret;
r->rv30 = 1;
- ff_rv34_decode_init(avctx);
+ if ((ret = ff_rv34_decode_init(avctx)) < 0)
+ return ret;
if(avctx->extradata_size < 2){
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
return -1;
diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
index 98e94eaa97..c46b7ef7e1 100644
--- a/libavcodec/rv40.c
+++ b/libavcodec/rv40.c
@@ -544,9 +544,11 @@ static void rv40_loop_filter(RV34DecContext *r, int row)
static av_cold int rv40_decode_init(AVCodecContext *avctx)
{
RV34DecContext *r = avctx->priv_data;
+ int ret;
r->rv30 = 0;
- ff_rv34_decode_init(avctx);
+ if ((ret = ff_rv34_decode_init(avctx)) < 0)
+ return ret;
if(!aic_top_vlc.bits)
rv40_init_tables();
r->parse_slice_header = rv40_parse_slice_header;
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 552c0bf141..6f5a2a91ac 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -613,9 +613,9 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
dir = i_mb_type_info[mb_type - 8].pred_mode;
dir = (dir >> 1) ^ 3*(dir & 1) ^ 1;
- if ((h->intra16x16_pred_mode = ff_h264_check_intra_pred_mode(h, dir, 0)) == -1){
- av_log(h->s.avctx, AV_LOG_ERROR, "check_intra_pred_mode = -1\n");
- return -1;
+ if ((h->intra16x16_pred_mode = ff_h264_check_intra_pred_mode(h, dir, 0)) < 0) {
+ av_log(h->s.avctx, AV_LOG_ERROR, "ff_h264_check_intra_pred_mode < 0\n");
+ return h->intra16x16_pred_mode;
}
cbp = i_mb_type_info[mb_type - 8].cbp;
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index f4f87d3349..10c5b8c36f 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2150,6 +2150,10 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
fps.num = get_bits_long(gb, 32);
fps.den = get_bits_long(gb, 32);
if (fps.num && fps.den) {
+ if (fps.num < 0 || fps.den < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid framerate\n");
+ return AVERROR_INVALIDDATA;
+ }
av_reduce(&avctx->time_base.num, &avctx->time_base.den,
fps.den, fps.num, 1<<30);
}