X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Frscc.c;h=7921f149ed5dd1e020917d6004eb1ba4f4f5dd26;hb=1a45b12cdc414794795c11db378d0be6113a22d3;hp=dae5e8463452087c2c5cba58c6f6834b95014c1b;hpb=18195e570cfb83149e5eea203b4b5ee84babd420;p=ffmpeg diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c index dae5e846345..7921f149ed5 100644 --- a/libavcodec/rscc.c +++ b/libavcodec/rscc.c @@ -85,8 +85,18 @@ static av_cold int rscc_init(AVCodecContext *avctx) /* Get pixel format and the size of the pixel */ if (avctx->codec_tag == MKTAG('I', 'S', 'C', 'C')) { - avctx->pix_fmt = AV_PIX_FMT_BGRA; - ctx->component_size = 4; + if (avctx->extradata && avctx->extradata_size == 4) { + if ((avctx->extradata[0] >> 1) & 1) { + avctx->pix_fmt = AV_PIX_FMT_BGRA; + ctx->component_size = 4; + } else { + avctx->pix_fmt = AV_PIX_FMT_BGR24; + ctx->component_size = 3; + } + } else { + avctx->pix_fmt = AV_PIX_FMT_BGRA; + ctx->component_size = 4; + } } else if (avctx->codec_tag == MKTAG('R', 'S', 'C', 'C')) { ctx->component_size = avctx->bits_per_coded_sample / 8; switch (avctx->bits_per_coded_sample) {