VapourSynth/video_output: Fix crash when read unexpected format#78
Open
enccc wants to merge 1 commit into
Open
VapourSynth/video_output: Fix crash when read unexpected format#78enccc wants to merge 1 commit into
enccc wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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に私は疎いので修正の仕方が正しいか確認していただけませんか?