diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-13 17:38:20 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-13 17:41:09 +0300 |
commit | afa97144cff837bbe2ecce47e79321373a82cb94 (patch) | |
tree | 101c402ea913b21021a6e6001b9f138ed5c527a7 /libavcodec/hevc.c | |
parent | d13fc982470f5fe89b92ebbb93a101fb2b9e851e (diff) | |
parent | 077b55943330150db0eafd36bbee614697cabd98 (diff) |
Merge commit '077b55943330150db0eafd36bbee614697cabd98'
* commit '077b55943330150db0eafd36bbee614697cabd98':
hevc: handle a NULL sps in set_sps() properly
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 33c718d67e..157cdaeb3d 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -332,13 +332,19 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum AVPixelFormat pix_fm enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts; int ret, i; - export_stream_params(s->avctx, &s->ps, sps); - pic_arrays_free(s); + s->ps.sps = NULL; + s->ps.vps = NULL; + + if (!sps) + return 0; + ret = pic_arrays_init(s, sps); if (ret < 0) goto fail; + export_stream_params(s->avctx, &s->ps, sps); + if (sps->pix_fmt == AV_PIX_FMT_YUV420P || sps->pix_fmt == AV_PIX_FMT_YUVJ420P) { #if CONFIG_HEVC_DXVA2_HWACCEL *fmt++ = AV_PIX_FMT_DXVA2_VLD; |