Commit fa48da1e authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg: fix null ptr deref in psnr printing code

Fixes CID205005
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a1af505d
...@@ -1123,7 +1123,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti ...@@ -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++) for (j = 0; j < 32; j++)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%X", (int)lrintf(log2(qp_histogram[j] + 1))); 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; int j;
double error, error_sum = 0; double error, error_sum = 0;
double scale, scale_sum = 0; double scale, scale_sum = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment