Browse Source

avcodec/imgconvert: fix possible null pointer dereference

regression since 354b26a394

(cherry picked from commit 8c2c97403b)
(cherry picked from commit c1e172c2e1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n2.8.15
Simon Thelen Michael Niedermayer 7 years ago
parent
commit
03af6ab540
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      libavcodec/imgconvert.c

+ 3
- 2
libavcodec/imgconvert.c View File

@@ -84,11 +84,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;
}



Loading…
Cancel
Save