diff options
author | Martin Storsjö <martin@martin.st> | 2012-08-28 15:27:10 +0400 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-08-28 19:15:38 +0400 |
commit | 6f5b1a2ba4cc568b3b8ae11b7dfd4a70fb891680 (patch) | |
tree | 7f44d5052fbba68200f22cbbc3099a8f5f07825b /libavcodec/h264.c | |
parent | 0b58c77ed18ae1c0b47e4f25e43550dfc48da0e1 (diff) |
h264: Check that the codec isn't null before accessing it
This fixes crashes introduced by 2e8f3cbcda5, the codec can be null
when called from parsers.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a191bc74de..2c4f07d601 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3876,7 +3876,8 @@ again: if (avctx->bits_per_raw_sample != h->sps.bit_depth_luma || 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.chroma_format_idc > 1)) { av_log(avctx, AV_LOG_ERROR, |