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
597597 }
598598
599599 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+ }
600606 if (!f->transparency && !f->chroma_planes) {
601607 if (f->avctx->bits_per_raw_sample <= 8)
602608 f->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
@@ -695,6 +701,11 @@ static int read_header(FFV1Context *f) · 92 unmodified lines
695701 "chroma subsampling not supported in this colorspace\n");
696702 return AVERROR(ENOSYS);
697703 }
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+ }
698709 switch (f->avctx->bits_per_raw_sample) {
699710 case 0:
700711 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