diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-23 10:42:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-23 10:42:11 +0200 |
commit | 3e78f8689167d6edcf15afb2836ede9505bca1a2 (patch) | |
tree | fd603ef19cd1bfaff0a5ffb672597501ee3d7c14 | |
parent | 0edc79962641dd853cda187ee13b617701346061 (diff) | |
parent | 68fd80ee1ca22c39b6ef4e6641b5b2e0d4d89a14 (diff) | |
download | ffmpeg-3e78f8689167d6edcf15afb2836ede9505bca1a2.tar.gz |
Merge commit '68fd80ee1ca22c39b6ef4e6641b5b2e0d4d89a14' into release/2.2
* commit '68fd80ee1ca22c39b6ef4e6641b5b2e0d4d89a14':
g2meet: allow size changes within original sizes
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/g2meet.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 70b5f26049..aaf1abb6dc 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -87,6 +87,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; @@ -700,8 +701,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); @@ -867,6 +868,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; } |