所以我不太確定我是否遇到了 Git 問題,或者更有可能我不太了解 Git 提交是如何作業的。我試圖解決的問題是檢查某個版本的 FFmpeg 是否已解決問題。下面的提交應該解決一個特定的問題
https://github.com/FFmpeg/FFmpeg/commit/4a71da0f3ab7f5542decd11c81994f849d5b2c78
這一切都很好,直到您轉到包含提交的標簽之一并看到它只是部分(?)應用了它
https://github.com/FFmpeg/FFmpeg/blob/n0.9/libavcodec/cavsdec.c
即第if (level_code >= 0)133 行的部分丟失了!其他更新仍然存在并可通過“責備”進行跟蹤。然而,“責備”似乎沒有任何線索表明缺失的變化曾經發生過。
我覺得奇怪的另一個事實是,您可以轉到 0.6.7 標簽,該標簽選擇了相同的提交,并看到它這次應用了所有更改。
https://github.com/FFmpeg/FFmpeg/blob/n0.6.7/libavcodec/cavsdec.c
https://github.com/FFmpeg/FFmpeg/commit/7a6bba627d643ba9e9cc083f21475a0035b0f06f
這似乎不是一個展示性的 Github 錯誤,我嘗試從 ffmpeg 站點獲取實際版本并確認代碼與所提供的一樣
https://ffmpeg.org/releases/
如果有人知道這里會發生什么,我的好奇心會非常感激。
uj5u.com熱心網友回復:
我認為它可能在下一次合并到主線時被洗掉了。
如果您查看libavcodec/cavsdec.c您確定的提交 ( 4a71da0f3a) 和缺少該檢查的標記( )之間的更改n0.9,我們有以下內容:
$ git log --oneline --graph 4a71da0f3a^..n0.9 libavcodec/cavsdec.c
* dd8ffc1925 Merge remote-tracking branch 'qatar/master'
|\
| * 9138a130cd lavc: use avpriv_ prefix for ff_frame_rate_tab.
| * 773375c3d0 lavc: rename ff_find_start_code to avpriv_mpv_find_start_code
* | d912e449b6 Merge remote-tracking branch 'qatar/master'
|\|
| * 4a71da0f3a cavs: fix some crashes with invalid bitstreams
* 961a1a81d8 cavsdec: check run value validity
* 9f06c1c61e cavsdec: avoid possible crash with crafted input
* 6481a36010 cavs: fix oCERT #2011-002 FFmpeg/libavcodec insufficient boundary check
* faba79e080 Merge remote-tracking branch 'qatar/master'
* e10979ff56 Merge remote-tracking branch 'qatar/master'
* ce5e49b0c2 replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*
* e7e2df27f8 Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.
我建議查看的地方是合并提交(d912e449b6和dd8ffc1925)。檢查第一個合并提交的更改,(左和右)我們有:
$ git diff -U0 d912e449b6^1 d912e449b6 libavcodec/cavsdec.c
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index fcfe06e2ce..fedee8bf72 100644
--- a/libavcodec/cavsdec.c
b/libavcodec/cavsdec.c
@@ -195 195,2 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
- int block, pred_mode_uv;
unsigned pred_mode_uv;
int block;
@@ -450,0 452,2 @@ static inline int check_for_slice(AVSContext *h) {
if (h->stc >= h->mb_height)
return 0;
@@ -665 668 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
- if(stc & 0xFFFFFE00)
if((stc & 0xFFFFFE00) || buf_ptr == buf_end)
和:
$ git diff -U0 d912e449b6^2 d912e449b6 libavcodec/cavsdec.c
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 88034068ff..fedee8bf72 100644
--- a/libavcodec/cavsdec.c
b/libavcodec/cavsdec.c
@@ -5 5 @@
- * This file is part of Libav.
* This file is part of FFmpeg.
@@ -7 7 @@
- * Libav is free software; you can redistribute it and/or
* FFmpeg is free software; you can redistribute it and/or
@@ -12 12 @@
- * Libav is distributed in the hope that it will be useful,
* FFmpeg is distributed in the hope that it will be useful,
@@ -18 18 @@
- * License along with Libav; if not, write to the Free Software
* License along with FFmpeg; if not, write to the Free Software
@@ -118 118,2 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
- int i, level_code, esc_code, level, run, mask;
int i, esc_code, level, mask;
unsigned int level_code, run;
@@ -126,0 128,2 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
if(run > 64)
return -1;
@@ -133 136 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
- } else if (level_code >= 0) {
} else {
@@ -139,2 141,0 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
- } else {
- break;
@@ -168 169 @@ static inline int decode_residual_inter(AVSContext *h) {
- if(cbp > 63){
if(cbp > 63U){
@@ -228 229 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
- if(cbp_code > 63){
if(cbp_code > 63U){
您可以看到第二個差異的一部分洗掉了該檢查:
@@ -133 136 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
- } else if (level_code >= 0) {
} else {
這似乎是罪魁禍首。
我認為該提交的另一部分可能暗示了原因:
@@ -5 5 @@
- * This file is part of Libav.
* This file is part of FFmpeg.
as this appears to have been part of an ongoing effort to merge parts of Libav, a fork of FFmpeg that is now abandoned, so perhaps there were merge issues, though redoing the merge myself:
$ git checkout d912e449b6^1
$ git merge --no-edit --no-ff d912e449b6^2
applies without any conflicts, but definitely doesn't contain the change:
$ git diff -U0 d912e449b6 HEAD libavcodec/cavsdec.c
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index fedee8bf72..1b8fedf2b1 100644
--- a/libavcodec/cavsdec.c
b/libavcodec/cavsdec.c
@@ -136 136 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
- } else {
} else if (level_code >= 0) {
@@ -141,0 142,2 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
} else {
break;
It is possible that git has become a lot better at handling merges like this in the 10 years since that commit was pushed; perhaps back then it required a manual merge of some conflicts?
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/349143.html
下一篇:還原合并的拉取請求
