diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-29 03:00:38 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-29 03:16:09 +0100 |
commit | 3477874abdd4a892ec3df2a9685ed959e2f73f21 (patch) | |
tree | 87eb3af9a69797d59cd666ad1841e97ce608ae31 | |
parent | 54bb30bae2ec6d721dd4dd89fff762b14fcf68e4 (diff) | |
parent | 344d6db978af251e32b886f4c54e993771004fc0 (diff) | |
download | ffmpeg-3477874abdd4a892ec3df2a9685ed959e2f73f21.tar.gz |
Merge branch 'master' of https://github.com/upsuper/ffmpeg-vdadec
* 'master' of https://github.com/upsuper/ffmpeg-vdadec:
avcodec/vda_h264_dec: add format check
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/vda_h264_dec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/vda_h264_dec.c b/libavcodec/vda_h264_dec.c index e5fa8071b3..d2ef5dc9a6 100644 --- a/libavcodec/vda_h264_dec.c +++ b/libavcodec/vda_h264_dec.c @@ -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: |