Commit 5cd947d8 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Fix r10k codec for widths that are not multiples of 64.

Fixes ticket #1358
parent 77cea13f
...@@ -41,7 +41,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, ...@@ -41,7 +41,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int h, w; int h, w;
AVFrame *pic = avctx->coded_frame; AVFrame *pic = avctx->coded_frame;
const uint32_t *src = (const uint32_t *)avpkt->data; const uint32_t *src = (const uint32_t *)avpkt->data;
int aligned_width = FFALIGN(avctx->width, 64); int aligned_width = FFALIGN(avctx->width,
avctx->codec_id == CODEC_ID_R10K ? 1 : 64);
uint8_t *dst_line; uint8_t *dst_line;
if (pic->data[0]) if (pic->data[0])
......
...@@ -38,7 +38,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, ...@@ -38,7 +38,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pic, int *got_packet) const AVFrame *pic, int *got_packet)
{ {
int i, j, ret; int i, j, ret;
int aligned_width = FFALIGN(avctx->width, 64); int aligned_width = FFALIGN(avctx->width,
avctx->codec_id == CODEC_ID_R10K ? 1 : 64);
int pad = (aligned_width - avctx->width) * 4; int pad = (aligned_width - avctx->width) * 4;
uint8_t *src_line; uint8_t *src_line;
uint8_t *dst; uint8_t *dst;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment