diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-01 00:35:02 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-01 00:44:44 +0100 |
commit | f105fe5c22c5b7f426f65d82bee0de47c14bad65 (patch) | |
tree | 1e8d65289ab83bedbc1ca6455eeb34c6434d4d1b /libavcodec/rawdec.c | |
parent | 67abe21c0bdc6fa234ce359f398c77506602f986 (diff) | |
download | ffmpeg-streaming-f105fe5c22c5b7f426f65d82bee0de47c14bad65.zip ffmpeg-streaming-f105fe5c22c5b7f426f65d82bee0de47c14bad65.tar.gz |
rawdec: fix decoding of odd dimensioned raw yv12
Fix Ticket339 part 2 of 2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r-- | libavcodec/rawdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 5002ccc..af42114 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -246,6 +246,11 @@ static int raw_decode(AVCodecContext *avctx, || avctx->codec_tag == MKTAG('Y', 'V', 'U', '9')) FFSWAP(uint8_t *, picture->data[1], picture->data[2]); + if (avctx->codec_tag == AV_RL32("I420") && (avctx->width+1)*(avctx->height+1) * 3/2 == buf_size) { + picture->data[1] = picture->data[1] + (avctx->width+1)*(avctx->height+1) -avctx->width*avctx->height; + picture->data[2] = picture->data[2] + ((avctx->width+1)*(avctx->height+1) -avctx->width*avctx->height)*5/4; + } + if(avctx->codec_tag == AV_RL32("yuv2") && avctx->pix_fmt == AV_PIX_FMT_YUYV422) { int x, y; |