瀏覽代碼

avcodec/r210dec: fix r10x decoding

Paul B Mahol 7 年之前
父節點
當前提交
060ea5261d
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      libavcodec/r210dec.c

+ 5 - 1
libavcodec/r210dec.c

@@ -73,10 +73,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
             } else {
                 pixel = av_be2ne32(*src++);
             }
-            if (avctx->codec_id == AV_CODEC_ID_R210 || r10) {
+            if (avctx->codec_id == AV_CODEC_ID_R210) {
                 b =  pixel & 0x3ff;
                 g = (pixel >> 10) & 0x3ff;
                 r = (pixel >> 20) & 0x3ff;
+            } else if (r10) {
+                r =  pixel & 0x3ff;
+                g = (pixel >> 10) & 0x3ff;
+                b = (pixel >> 20) & 0x3ff;
             } else {
                 b = (pixel >>  2) & 0x3ff;
                 g = (pixel >> 12) & 0x3ff;