aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-01-30 13:31:44 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-01-30 13:31:44 +0100
commitd391feff544f014a01393673f373bbdbca8c9af5 (patch)
tree8504a894d30040d2377029e409ed611fb3d26661
parent0275b2d9175475c10040772d87e9ee6911467004 (diff)
downloadffmpeg-d391feff544f014a01393673f373bbdbca8c9af5.tar.gz
lavc/v210dec: Allow odd width.
The rightmost column is not decoded correctly. Fixes a part of ticket #5195.
-rw-r--r--libavcodec/v210dec.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 12d5d5407f..9af9af6797 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -53,10 +53,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
{
V210DecContext *s = avctx->priv_data;
- if (avctx->width & 1) {
- av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
- return AVERROR_INVALIDDATA;
- }
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
avctx->bits_per_raw_sample = 10;
@@ -141,7 +137,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
psrc += stride;
- y += pic->linesize[0] / 2 - avctx->width;
+ y += pic->linesize[0] / 2 - avctx->width + (avctx->width & 1);
u += pic->linesize[1] / 2 - avctx->width / 2;
v += pic->linesize[2] / 2 - avctx->width / 2;
}