Transparency is supported only by YUV and within specific bit depths.
Unified · Split
| @@ -597,6 +597,12 @@ static int read_header(FFV1Context *f) · 596 unmodified lines | |||
| 597 | } | 597 | } |
| 598 | 598 | ||
| 599 | if (f->colorspace == 0) { | 599 | if (f->colorspace == 0) { |
| 600 | if (f->transparency && f->avctx->bits_per_raw_sample > 8) { | ||
| 601 | av_log(f->avctx, AV_LOG_ERROR, | ||
| 602 | "Transparency not supported for bit depth %d\n", | ||
| 603 | f->avctx->bits_per_raw_sample); | ||
| 604 | return AVERROR(ENOSYS); | ||
| 605 | } | ||
| 600 | if (!f->transparency && !f->chroma_planes) { | 606 | if (!f->transparency && !f->chroma_planes) { |
| 601 | if (f->avctx->bits_per_raw_sample <= 8) | 607 | if (f->avctx->bits_per_raw_sample <= 8) |
| 602 | f->avctx->pix_fmt = AV_PIX_FMT_GRAY8; | 608 | f->avctx->pix_fmt = AV_PIX_FMT_GRAY8; |
| @@ -695,6 +701,11 @@ static int read_header(FFV1Context *f) · 92 unmodified lines | |||
| 695 | "chroma subsampling not supported in this colorspace\n"); | 701 | "chroma subsampling not supported in this colorspace\n"); |
| 696 | return AVERROR(ENOSYS); | 702 | return AVERROR(ENOSYS); |
| 697 | } | 703 | } |
| 704 | if (f->transparency) { | ||
| 705 | av_log(f->avctx, AV_LOG_ERROR, | ||
| 706 | "Transparency not supported in this colorspace\n"); | ||
| 707 | return AVERROR(ENOSYS); | ||
| 708 | } | ||
| 698 | switch (f->avctx->bits_per_raw_sample) { | 709 | switch (f->avctx->bits_per_raw_sample) { |
| 699 | case 0: | 710 | case 0: |
| 700 | case 8: | 711 | case 8: |