diff mbox series

[FFmpeg-devel,5/5] doc/examples/qsv_transcode: Initialize pointer before free

Message ID 20240424014522.4015429-5-michael@niedermayer.cc
State Accepted
Commit cae0f2bc550312c99655057f8ffab5b59556ceeb
Headers show
Series [FFmpeg-devel,1/5] doc/examples/demux_decode: Simplify loop | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Michael Niedermayer April 24, 2024, 1:45 a.m. UTC
Fixees: CID1517023 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 doc/examples/qsv_transcode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Xiang, Haihao April 24, 2024, 5:19 a.m. UTC | #1
On Wo, 2024-04-24 at 03:45 +0200, Michael Niedermayer wrote:
> Fixees: CID1517023 Uninitialized pointer read
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  doc/examples/qsv_transcode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/doc/examples/qsv_transcode.c b/doc/examples/qsv_transcode.c
> index 8e843ddd84c..665a76af2ed 100644
> --- a/doc/examples/qsv_transcode.c
> +++ b/doc/examples/qsv_transcode.c
> @@ -342,7 +342,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 <input file> <encoder> <output
> file>"

LGTM,

- Haihao
diff mbox series

Patch

diff --git a/doc/examples/qsv_transcode.c b/doc/examples/qsv_transcode.c
index 8e843ddd84c..665a76af2ed 100644
--- a/doc/examples/qsv_transcode.c
+++ b/doc/examples/qsv_transcode.c
@@ -342,7 +342,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 <input file> <encoder> <output file>"