|
|
@ -119,6 +119,7 @@ static int raw_decode(AVCodecContext *avctx, |
|
|
|
const uint8_t *buf = avpkt->data; |
|
|
|
const uint8_t *buf = avpkt->data; |
|
|
|
int buf_size = avpkt->size; |
|
|
|
int buf_size = avpkt->size; |
|
|
|
RawVideoContext *context = avctx->priv_data; |
|
|
|
RawVideoContext *context = avctx->priv_data; |
|
|
|
|
|
|
|
int res; |
|
|
|
|
|
|
|
|
|
|
|
AVFrame *frame = data; |
|
|
|
AVFrame *frame = data; |
|
|
|
AVPicture *picture = data; |
|
|
|
AVPicture *picture = data; |
|
|
@ -156,7 +157,9 @@ static int raw_decode(AVCodecContext *avctx, |
|
|
|
avctx->codec_tag == MKTAG('A', 'V', 'u', 'p')) |
|
|
|
avctx->codec_tag == MKTAG('A', 'V', 'u', 'p')) |
|
|
|
buf += buf_size - context->length; |
|
|
|
buf += buf_size - context->length; |
|
|
|
|
|
|
|
|
|
|
|
avpicture_fill(picture, buf, avctx->pix_fmt, avctx->width, avctx->height); |
|
|
|
if ((res = avpicture_fill(picture, buf, avctx->pix_fmt, |
|
|
|
|
|
|
|
avctx->width, avctx->height)) < 0) |
|
|
|
|
|
|
|
return res; |
|
|
|
if((avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length) || |
|
|
|
if((avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length) || |
|
|
|
(av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PSEUDOPAL)) { |
|
|
|
(av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PSEUDOPAL)) { |
|
|
|
frame->data[1]= context->palette; |
|
|
|
frame->data[1]= context->palette; |
|
|
|