Commit e7dc6231 authored by Simon Thelen's avatar Simon Thelen Committed by Michael Niedermayer

avcodec/imgconvert: fix possible null pointer dereference

regression since 354b26a3

(cherry picked from commit 8c2c9740)
(cherry picked from commit c1e172c2)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 0c9c4c31
......@@ -80,11 +80,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