Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ffmpeg: fix negative array index

Fixes CID733808
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information...
commit c3778df2d4c05e76d28d77a2d740e435393046c9 1 parent 6182e0a
@michaelni michaelni authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  ffmpeg_filter.c
View
3  ffmpeg_filter.c
@@ -37,7 +37,8 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
{
if (codec && codec->pix_fmts) {
const enum AVPixelFormat *p = codec->pix_fmts;
- int has_alpha= av_pix_fmt_desc_get(target)->nb_components % 2 == 0;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
+ int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
Please sign in to comment.
Something went wrong with that request. Please try again.