Skip to content

Commit

Permalink
avcodec: missing error handling in lavc_UpdateVideoFormat()
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Denis-Courmont committed Apr 23, 2015
1 parent 82985a6 commit 6aeb9a2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions modules/codec/avcodec/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,8 @@ static int lavc_UpdateVideoFormat( decoder_t *p_dec,
}

if( !hwaccel && GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) )
{
/* we are doomed, but not really, because most codecs set their pix_fmt
* much later
* FIXME does it make sense here ? */
p_dec->fmt_out.video.i_chroma = VLC_CODEC_I420;
}
return -1;

p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;

/* If an aspect-ratio was specified in the input format then force it */
Expand Down Expand Up @@ -192,8 +188,8 @@ static int lavc_UpdateVideoFormat( decoder_t *p_dec,
static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
AVCodecContext *p_context )
{
lavc_UpdateVideoFormat( p_dec, p_context );
/* FIXME: check for error ^^ and return NULL */
if (lavc_UpdateVideoFormat(p_dec, p_context))
return NULL;
return decoder_NewPicture( p_dec );
}

Expand Down

0 comments on commit 6aeb9a2

Please sign in to comment.