Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-25 03:16:34 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-10-25 03:38:15 +0400
commitfa48da1ee9ce2a29319159b0509ec0905b0e115a (patch)
tree6106a672e95a5270fb9d45d39f83f9faedf1a71e /ffmpeg.c
parenta1af505d6640a89401f8e9941a38352a1ca49d58 (diff)
ffmpeg: fix null ptr deref in psnr printing code
Fixes CID205005 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 03cefc8327..f86ecd554c 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;