Commit a4c7aeaf authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'eafbc671'

* commit 'eafbc671':
  vmnc: Delay pixel size check
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 6d1935d1 eafbc671
......@@ -432,10 +432,18 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
c->pic->pict_type = AV_PICTURE_TYPE_I;
depth = bytestream2_get_byte(gb);
if (depth != c->bpp) {
av_log(avctx, AV_LOG_INFO,
"Depth mismatch. Container %i bpp, "
"Frame data: %i bpp\n",
c->bpp, depth);
av_log(avctx, AV_LOG_WARNING, "Depth mismatch. "
"Container %i bpp / Codec %i bpp\n", c->bpp, depth);
if (depth != 8 && depth != 16 && depth != 32) {
av_log(avctx, AV_LOG_ERROR,
"Unsupported codec bitdepth %i\n", depth);
return AVERROR_INVALIDDATA;
}
/* reset values */
c->bpp = depth;
c->bpp2 = c->bpp / 8;
}
bytestream2_skip(gb, 1);
c->bigendian = bytestream2_get_byte(gb);
......@@ -537,6 +545,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
case 16:
avctx->pix_fmt = AV_PIX_FMT_RGB555;
break;
case 24:
/* 24 bits is not technically supported, but some clients might
* mistakenly set it -- delay the actual check until decode_frame() */
case 32:
avctx->pix_fmt = AV_PIX_FMT_0RGB32;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment