Message ID | tencent_2D9ABC40919A0A9FB2AB414E6D70222D0D08@qq.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] avcodec/mediacodec: fix incorrect crop info | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c index 2a605e7f5b..c1cbb28488 100644 --- a/libavcodec/mediacodecdec_common.c +++ b/libavcodec/mediacodecdec_common.c @@ -487,6 +487,11 @@ static int mediacodec_dec_parse_format(AVCodecContext *avctx, MediaCodecDecConte AMEDIAFORMAT_GET_INT32(s->crop_left, "crop-left", 0); AMEDIAFORMAT_GET_INT32(s->crop_right, "crop-right", 0); + if (s->crop_bottom == 0 || s->crop_right == 0) { + s->crop_top = s->crop_left = 0; + s->crop_right = s->width - 1; + s->crop_bottom = s->height - 1; + } width = s->crop_right + 1 - s->crop_left; height = s->crop_bottom + 1 - s->crop_top;