Commit 6f5b1a2b authored by Martin Storsjö's avatar Martin Storsjö

h264: Check that the codec isn't null before accessing it

This fixes crashes introduced by 2e8f3cbc, the codec can be null
when called from parsers.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 0b58c77e
...@@ -3876,7 +3876,8 @@ again: ...@@ -3876,7 +3876,8 @@ again:
if (avctx->bits_per_raw_sample != h->sps.bit_depth_luma || if (avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
h->cur_chroma_format_idc != h->sps.chroma_format_idc) { h->cur_chroma_format_idc != h->sps.chroma_format_idc) {
if (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU if (s->avctx->codec &&
s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU
&& (h->sps.bit_depth_luma != 8 || && (h->sps.bit_depth_luma != 8 ||
h->sps.chroma_format_idc > 1)) { h->sps.chroma_format_idc > 1)) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
......
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