[FFmpeg-cvslog] ffmpeg: fix null ptr deref in psnr printing code

Michael Niedermayer git at videolan.org
Thu Oct 25 01:39:24 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 25 01:16:34 2012 +0200| [fa48da1ee9ce2a29319159b0509ec0905b0e115a] | committer: Michael Niedermayer

ffmpeg: fix null ptr deref in psnr printing code

Fixes CID205005
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fa48da1ee9ce2a29319159b0509ec0905b0e115a
---

 ffmpeg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 03cefc8..f86ecd5 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1123,7 +1123,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
                 for (j = 0; j < 32; j++)
                     snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%X", (int)lrintf(log2(qp_histogram[j] + 1)));
             }
-            if (enc->flags&CODEC_FLAG_PSNR) {
+            if ((enc->flags&CODEC_FLAG_PSNR) && (enc->coded_frame || is_last_report)) {
                 int j;
                 double error, error_sum = 0;
                 double scale, scale_sum = 0;



More information about the ffmpeg-cvslog mailing list