diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c index c1f6003f60..f5b01bb992 100644 --- a/libavcodec/qsvenc_h264.c +++ b/libavcodec/qsvenc_h264.c @@ -53,7 +53,7 @@ static int qsv_h264_set_encode_ctrl(AVCodecContext *avctx, int res; res = ff_alloc_a53_sei(frame, sizeof(mfxPayload) + 2, (void**)&payload, &sei_size); - if (res < 0) + if (res < 0 || !payload) return res; sei_data = (mfxU8*)(payload + 1);