diff --git a/doc/examples/qsv_transcode.c b/doc/examples/qsv_transcode.c
index 486910f09a..ff115f3669 100644
--- a/doc/examples/qsv_transcode.c
+++ b/doc/examples/qsv_transcode.c
@@ -341,7 +341,7 @@ int main(int argc, char **argv)
{
const AVCodec *enc_codec;
int ret = 0;
- AVPacket *dec_pkt;
+ AVPacket *dec_pkt = NULL;
if (argc < 5 || (argc - 5) % 2) {
av_log(NULL, AV_LOG_ERROR, "Usage: %s