Commit 8c2c9740 authored by Simon Thelen's avatar Simon Thelen Committed by Paul B Mahol

avcodec/imgconvert: fix possible null pointer dereference

regression since 354b26a3
parent 4b736bc9
......@@ -72,11 +72,12 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(const enum AVPixelFormat *p
int loss;
for (i=0; pix_fmt_list[i] != AV_PIX_FMT_NONE; i++) {
loss = *loss_ptr;
loss = loss_ptr ? *loss_ptr : 0;
best = avcodec_find_best_pix_fmt_of_2(best, pix_fmt_list[i], src_pix_fmt, has_alpha, &loss);
}
*loss_ptr = loss;
if (loss_ptr)
*loss_ptr = loss;
return best;
}
......
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