History

ffv1: Error out on unsupported format

Transparency is supported only by YUV and within specific bit depths.

Jerome Martinez committed 10 years ago

Commit ec9f0441 parent 105998f1 file · +11 −0Browse files

Unified · Split

libavcodec/ffv1dec.c+11−0
@@ -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:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t