mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/imgconvert: fix possible null pointer dereference
regression since 354b26a394
This commit is contained in:
parent
4b736bc921
commit
8c2c97403b
@ -72,11 +72,12 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(const enum AVPixelFormat *p
|
|||||||
int loss;
|
int loss;
|
||||||
|
|
||||||
for (i=0; pix_fmt_list[i] != AV_PIX_FMT_NONE; i++) {
|
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);
|
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;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user