aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-01 15:49:58 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-01 15:49:58 +0100
commit98ca3fb9cf7fdfad38e731ffb029fa3f96b94581 (patch)
treef1cec553a2ad4be7135cc63adc061bc234f38c64
parentffd100b111f4d494a9d70dae0efef0307eaf84d8 (diff)
parent757d5e8ef98ba2ab0dd0e85a46290c4f4a7e82be (diff)
downloadffmpeg-98ca3fb9cf7fdfad38e731ffb029fa3f96b94581.tar.gz
Merge commit '757d5e8ef98ba2ab0dd0e85a46290c4f4a7e82be'
* commit '757d5e8ef98ba2ab0dd0e85a46290c4f4a7e82be': vp8: stop using deprecated avcodec_set_dimensions vp56: stop using deprecated avcodec_set_dimensions vp3: stop using deprecated avcodec_set_dimensions txd: stop using deprecated avcodec_set_dimensions truemotion1: stop using deprecated avcodec_set_dimensions Conflicts: libavcodec/txd.c libavcodec/vp56.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/truemotion1.c7
-rw-r--r--libavcodec/txd.c5
-rw-r--r--libavcodec/vp3.c13
-rw-r--r--libavcodec/vp5.c5
-rw-r--r--libavcodec/vp56.c2
-rw-r--r--libavcodec/vp6.c8
-rw-r--r--libavcodec/vp8.c9
7 files changed, 26 insertions, 23 deletions
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index d72cee8aea..b1de99b7ea 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -397,15 +397,16 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
new_pix_fmt = AV_PIX_FMT_RGB555; // RGB565 is supported as well
s->w >>= width_shift;
- if ((ret = av_image_check_size(s->w, s->h, 0, s->avctx)) < 0)
- return ret;
if (s->w != s->avctx->width || s->h != s->avctx->height ||
new_pix_fmt != s->avctx->pix_fmt) {
av_frame_unref(&s->frame);
s->avctx->sample_aspect_ratio = (AVRational){ 1 << width_shift, 1 };
s->avctx->pix_fmt = new_pix_fmt;
- avcodec_set_dimensions(s->avctx, s->w, s->h);
+
+ if ((ret = ff_set_dimensions(s->avctx, s->w, s->h)) < 0)
+ return ret;
+
av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned int));
if (!s->vert_pred)
return AVERROR(ENOMEM);
diff --git a/libavcodec/txd.c b/libavcodec/txd.c
index 7526f1377c..ad1a0152f4 100644
--- a/libavcodec/txd.c
+++ b/libavcodec/txd.c
@@ -63,10 +63,9 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return AVERROR_PATCHWELCOME;
}
- if ((ret = av_image_check_size(w, h, 0, avctx)) < 0)
+ if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
return ret;
- if (w != avctx->width || h != avctx->height)
- avcodec_set_dimensions(avctx, w, h);
+
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
return ret;
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index b21b6e2437..bfe745b443 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2196,6 +2196,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
Vp3DecodeContext *s = avctx->priv_data;
int visible_width, visible_height, colorspace;
int offset_x = 0, offset_y = 0;
+ int ret;
AVRational fps, aspect;
s->theora = get_bits_long(gb, 24);
@@ -2212,12 +2213,6 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
visible_width = s->width = get_bits(gb, 16) << 4;
visible_height = s->height = get_bits(gb, 16) << 4;
- if(av_image_check_size(s->width, s->height, 0, avctx)){
- av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n", s->width, s->height);
- s->width= s->height= 0;
- return -1;
- }
-
if (s->theora >= 0x030200) {
visible_width = get_bits_long(gb, 24);
visible_height = get_bits_long(gb, 24);
@@ -2268,9 +2263,11 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
if ( visible_width <= s->width && visible_width > s->width-16
&& visible_height <= s->height && visible_height > s->height-16
&& !offset_x && (offset_y == s->height - visible_height))
- avcodec_set_dimensions(avctx, visible_width, visible_height);
+ ret = ff_set_dimensions(avctx, visible_width, visible_height);
else
- avcodec_set_dimensions(avctx, s->width, s->height);
+ ret = ff_set_dimensions(avctx, s->width, s->height);
+ if (ret < 0)
+ return ret;
if (colorspace == 1) {
avctx->color_primaries = AVCOL_PRI_BT470M;
diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c
index 2ab90b7b5b..756dc9270c 100644
--- a/libavcodec/vp5.c
+++ b/libavcodec/vp5.c
@@ -28,6 +28,7 @@
#include "avcodec.h"
#include "get_bits.h"
+#include "internal.h"
#include "vp56.h"
#include "vp56data.h"
@@ -66,7 +67,9 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
if (!s->macroblocks || /* first frame */
16*cols != s->avctx->coded_width ||
16*rows != s->avctx->coded_height) {
- avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
+ int ret = ff_set_dimensions(s->avctx, 16 * cols, 16 * rows);
+ if (ret < 0)
+ return ret;
return VP56_SIZE_CHANGE;
}
} else if (!s->macroblocks)
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 6b9f3860bf..b3b9e3e4e5 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -470,7 +470,7 @@ static int vp56_size_changed(VP56Context *s)
s->mb_height = (avctx->coded_height+15) / 16;
if (s->mb_width > 1000 || s->mb_height > 1000) {
- avcodec_set_dimensions(avctx, 0, 0);
+ ff_set_dimensions(avctx, 0, 0);
av_log(avctx, AV_LOG_ERROR, "picture too big\n");
return -1;
}
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index 4cf11eea7e..f552524db6 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -32,6 +32,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "huffman.h"
+#include "internal.h"
#include "vp56.h"
#include "vp56data.h"
@@ -92,7 +93,10 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
s->avctx->coded_width = 16 * cols;
s->avctx->coded_height = 16 * rows;
} else {
- avcodec_set_dimensions(s->avctx, 16 * cols, 16 * rows);
+ int ret = ff_set_dimensions(s->avctx, 16 * cols, 16 * rows);
+ if (ret < 0)
+ return ret;
+
if (s->avctx->extradata_size == 1) {
s->avctx->width -= s->avctx->extradata[0] >> 4;
s->avctx->height -= s->avctx->extradata[0] & 0x0F;
@@ -154,7 +158,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
buf_size -= coeff_offset;
if (buf_size < 0) {
if (s->frames[VP56_FRAME_CURRENT]->key_frame)
- avcodec_set_dimensions(s->avctx, 0, 0);
+ ff_set_dimensions(s->avctx, 0, 0);
return AVERROR_INVALIDDATA;
}
if (s->use_huffman) {
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index c302ff6562..45288d5116 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -113,16 +113,15 @@ static void vp8_decode_flush(AVCodecContext *avctx)
static int update_dimensions(VP8Context *s, int width, int height)
{
AVCodecContext *avctx = s->avctx;
- int i;
+ int i, ret;
if (width != s->avctx->width || ((width+15)/16 != s->mb_width || (height+15)/16 != s->mb_height) && s->macroblocks_base ||
height != s->avctx->height) {
- if (av_image_check_size(width, height, 0, s->avctx))
- return AVERROR_INVALIDDATA;
-
vp8_decode_flush_impl(s->avctx, 1);
- avcodec_set_dimensions(s->avctx, width, height);
+ ret = ff_set_dimensions(s->avctx, width, height);
+ if (ret < 0)
+ return ret;
}
s->mb_width = (s->avctx->coded_width +15) / 16;