aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/g2meet.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-07-15 15:22:11 -0400
committerMichael Niedermayer <michaelni@gmx.at>2014-07-30 22:32:01 +0200
commitab1ea597bd69d0d13f655c8934e3fa9c772a0a8d (patch)
tree17c91522428c0a994bac00bf9910ec7b074f0531 /libavcodec/g2meet.c
parentee606fd0317df202b59946cf9b738c0a01056316 (diff)
downloadffmpeg-ab1ea597bd69d0d13f655c8934e3fa9c772a0a8d.tar.gz
g2meet: allow size changes within original sizes
(cherry picked from commit 14b4e64eabc84c5a5e57c8ccc56bbeb95380823b) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/g2meet.c')
-rw-r--r--libavcodec/g2meet.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index 60c48c382f..1004e1921e 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -90,6 +90,7 @@ typedef struct G2MContext {
int compression;
int width, height, bpp;
+ int orig_width, orig_height;
int tile_width, tile_height;
int tiles_x, tiles_y, tile_x, tile_y;
@@ -712,8 +713,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
c->width = bytestream2_get_be32(&bc);
c->height = bytestream2_get_be32(&bc);
- if (c->width < 16 || c->width > avctx->width ||
- c->height < 16 || c->height > avctx->height) {
+ if (c->width < 16 || c->width > c->orig_width ||
+ c->height < 16 || c->height > c->orig_height) {
av_log(avctx, AV_LOG_ERROR,
"Invalid frame dimensions %dx%d\n",
c->width, c->height);
@@ -882,6 +883,10 @@ static av_cold int g2m_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_RGB24;
+ // store original sizes and check against those if resize happens
+ c->orig_width = avctx->width;
+ c->orig_height = avctx->height;
+
return 0;
}