[FFmpeg-devel] [PATCH] libavcodec/png_parser.c: fix a use_of_uninitialized_value in target_dec_fuzzer.

Thierry Foucu tfoucu at gmail.com
Thu Jun 4 21:40:33 EEST 2020


target_dec_fuzzer is checking for the avpkt.data pointer but if the
png parser cannot combine the frame, the poutbuf is not set and so, the
avpkt.data is not initialized.
---
 libavcodec/png_parser.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/png_parser.c b/libavcodec/png_parser.c
index 74f2964118..d1b2926154 100644
--- a/libavcodec/png_parser.c
+++ b/libavcodec/png_parser.c
@@ -99,8 +99,11 @@ static int png_parse(AVCodecParserContext *s, AVCodecContext *avctx,
     }
 
 flush:
-    if (ff_combine_frame(&ppc->pc, next, &buf, &buf_size) < 0)
+    if (ff_combine_frame(&ppc->pc, next, &buf, &buf_size) < 0) {
+        *poutbuf = NULL;
+        *poutbuf_size = 0;
         return buf_size;
+    }
 
     ppc->chunk_pos = ppc->pc.frame_start_found = 0;
 
-- 
2.27.0.rc2.251.g90737beb825-goog



More information about the ffmpeg-devel mailing list