summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-10-27 10:02:26 +0100
committerAnton Khirnov <anton@khirnov.net>2013-10-31 20:14:16 +0100
commitb53febc1c0da9729d7b55148c0097985d83e4cc4 (patch)
tree036a160fdf6885b1ecea280cc5b494201a7b8b8b
parent3cfdb912cb5ba788b13999a02698a60a85c0828b (diff)
downloadffmpeg-b53febc1c0da9729d7b55148c0097985d83e4cc4.tar.gz
vp3: stop using deprecated avcodec_set_dimensions
-rw-r--r--libavcodec/vp3.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 467dfd5655..d596816066 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2166,6 +2166,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);
@@ -2182,12 +2183,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);
@@ -2234,9 +2229,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;