Skip to content

Commit

Permalink
Fix a segfault in ffmpeg_cleanups()
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelCarpintero authored and AngelCarpintero committed Oct 5, 2007
1 parent 6a125b1 commit 7ddaa8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ffmpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ void ffmpeg_cleanups(struct ffmpeg *ffmpeg)
/* close each codec */
if (ffmpeg->video_st) {
pthread_mutex_lock(&global_lock);
avcodec_close(AVSTREAM_CODEC_PTR(ffmpeg->video_st));
if (ffmpeg->video_st->codec->priv_data != NULL)
avcodec_close(AVSTREAM_CODEC_PTR(ffmpeg->video_st));
pthread_mutex_unlock(&global_lock);
av_freep(&ffmpeg->picture);
free(ffmpeg->video_outbuf);
Expand Down

0 comments on commit 7ddaa8f

Please sign in to comment.