X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Frawdec.c;h=26663cabc2f23a6c75cd24839c30c51eda886cc0;hb=5663301560d77486c7f7c03c1aa5f542fab23c24;hp=53f5b76e93e7b61655ea4c3470e8bc4e4d08a56b;hpb=3e076faf3b86bb16f746e7c9b0cf3dac5f9a851a;p=ffmpeg diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 53f5b76e93e..26663cabc2f 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "bswapdsp.h" +#include "decode.h" #include "get_bits.h" #include "internal.h" #include "raw.h" @@ -223,7 +224,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, FFALIGN(avctx->width, 16), avctx->height, 1); } else { - context->is_lt_16bpp = av_get_bits_per_pixel(desc) == 16 && avctx->bits_per_coded_sample && avctx->bits_per_coded_sample < 16; + context->is_lt_16bpp = av_get_bits_per_pixel(desc) == 16 && avctx->bits_per_coded_sample > 8 && avctx->bits_per_coded_sample < 16; context->frame_size = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1); } @@ -467,10 +468,13 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, avctx->pix_fmt == AV_PIX_FMT_RGBA64BE) { uint8_t *dst = frame->data[0]; uint64_t v; - int x; - for (x = 0; x >> 3 < avctx->width * avctx->height; x += 8) { - v = AV_RB64(&dst[x]); - AV_WB64(&dst[x], v << 16 | v >> 48); + int x, y; + for (y = 0; y < avctx->height; y++) { + for (x = 0; x >> 3 < avctx->width; x += 8) { + v = AV_RB64(&dst[x]); + AV_WB64(&dst[x], v << 16 | v >> 48); + } + dst += frame->linesize[0]; } }