[FFmpeg-cvslog] avcodec/rscc: fix decoding of some iscc files

Paul B Mahol git at videolan.org
Sat Sep 8 18:39:56 EEST 2018


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Sep  8 17:27:40 2018 +0200| [068412f2e88b9fde731894bca685c25b985ec8e1] | committer: Paul B Mahol

avcodec/rscc: fix decoding of some iscc files

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=068412f2e88b9fde731894bca685c25b985ec8e1
---

 libavcodec/rscc.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c
index dae5e84634..7921f149ed 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) {



More information about the ffmpeg-cvslog mailing list