Bug 1226707: [ffmpeg] P1. Delete codec context upon initialization failure. r=gerald

This commit is contained in:
Jean-Yves Avenard 2015-11-21 22:22:00 +11:00
Родитель 81ca4c4489
Коммит ef21ca8081
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -117,6 +117,8 @@ FFmpegDataDecoder<LIBAV_VER>::InitDecoder()
if (avcodec_open2(mCodecContext, codec, nullptr) < 0) {
NS_WARNING("Couldn't initialise ffmpeg decoder");
avcodec_close(mCodecContext);
av_freep(&mCodecContext);
return NS_ERROR_FAILURE;
}