The flag of input_available must be set when pic_start is not NULL, so add an assert to ensure it is true. In addition, the assert on last_pic is unnecessary now, so remove this assert.
Unified · Split
| @@ -762,6 +762,8 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx) · 761 unmodified lines | ||
| 762 | 762 | VAAPIEncodeContext *ctx = avctx->priv_data; |
| 763 | 763 | VAAPIEncodePicture *pic, *last_pic, *next; |
| 764 | 764 | |
| 765 | + av_assert0(!ctx->pic_start || ctx->pic_start->input_available); | |
| 766 | + | |
| 765 | 767 | // Find the last picture we actually have input for. |
| 766 | 768 | for (pic = ctx->pic_start; pic; pic = pic->next) { |
| 767 | 769 | if (!pic->input_available) |
| @@ -770,8 +772,6 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx) · 2 unmodified lines | ||
| 770 | 772 | } |
| 771 | 773 | |
| 772 | 774 | if (pic) { |
| 773 | − av_assert0(last_pic); | |
| 774 | − | |
| 775 | 775 | if (last_pic->type == PICTURE_TYPE_B) { |
| 776 | 776 | // Some fixing up is required. Change the type of this |
| 777 | 777 | // picture to P, then modify preceding B references which |