]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/iff.c
rtpenc_aac: Fix 10l bug
[ffmpeg] / libavcodec / iff.c
index 3940a0cdaee9b0f976a5e8a65fec137390558d83..bc88a8e45b5dd41f2b283d71598540177a51f9f8 100644 (file)
@@ -330,8 +330,16 @@ static av_cold int decode_init(AVCodecContext *avctx)
         avctx->pix_fmt = (avctx->bits_per_coded_sample < 8) ||
                          (avctx->extradata_size >= 2 && palette_size) ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_GRAY8;
     } else if (avctx->bits_per_coded_sample <= 32) {
-        if (avctx->codec_tag != MKTAG('D','E','E','P'))
-            avctx->pix_fmt = AV_PIX_FMT_BGR32;
+        if (avctx->codec_tag != MKTAG('D','E','E','P')) {
+            if (avctx->bits_per_coded_sample == 24) {
+                avctx->pix_fmt = AV_PIX_FMT_RGB0;
+            } else if (avctx->bits_per_coded_sample == 32) {
+                avctx->pix_fmt = AV_PIX_FMT_BGR32;
+            } else {
+                av_log_ask_for_sample(avctx, "unknown bits_per_coded_sample\n");
+                return AVERROR_PATCHWELCOME;
+            }
+        }
     } else {
         return AVERROR_INVALIDDATA;
     }