Skip to content

VapourSynth/video_output: Fix crash when read unexpected format#78

Open
enccc wants to merge 1 commit into
VFR-maniac:masterfrom
enccc:fix_1
Open

VapourSynth/video_output: Fix crash when read unexpected format#78
enccc wants to merge 1 commit into
VFR-maniac:masterfrom
enccc:fix_1

Conversation

@enccc

@enccc enccc commented Apr 1, 2018

Copy link
Copy Markdown

determine_colorspace_conversion関数の問題を修正するものです。

再現方法は、以下のコマンドで作成したファイルをformatオプションを指定せずに読み込むことです。
ffmpeg -i input -c:v ffv1 -pix_fmt bgr0 output.mkv
本来は、 "lsmas: bgr0 is not supported" と返しエラー返すべきところがクラッシュします。

原因は以下だと思われます。
determine_colorspace_conversion 関数の中の conversion_table 変数と入力ファイルのフォーマットが一致しない時、
*output_pixel_format が AV_PIX_FMT_NONE のまま av_pix_fmt_desc_get関数 に渡され NULL が返ってきます。
そのまま NULL から flags を引っ張り出そうとしてアクセス違反が起こっていると思われます。

*output_pixel_format に AV_PIX_FMT_NONE が入ってる時点ですぐにエラーを返して関数を抜けてしまうことで対処できると思われます。

ffmpeg/libavのAPIに私は疎いので修正の仕方が正しいか確認していただけませんか?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant