1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-20 00:05:06 +02:00

avcodec/vda_h264_dec: add format check

Fix crash when using this decoder for unsupported format on some version
of OS X.
This commit is contained in:
Xidorn Quan 2013-12-27 00:05:36 +11:00
parent 14bec7dcf8
commit 344d6db978

View File

@ -235,6 +235,16 @@ static av_cold int vdadec_init(AVCodecContext *avctx)
}
ctx->h264_initialized = 1;
for (int i = 0; i < MAX_SPS_COUNT; i++) {
SPS *sps = ctx->h264ctx.sps_buffers[i];
if (sps && (sps->bit_depth_luma != 8 ||
sps->chroma_format_idc == 2 ||
sps->chroma_format_idc == 3)) {
av_log(avctx, AV_LOG_ERROR, "Format is not supported.\n");
goto failed;
}
}
return 0;
failed: