mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-14 02:50:11 +01:00
doc/examples/vaapi_encode: fix invalid check on fwrite
enc_pkt->size is 0 after av_packet_unref, which makes the check invalid. Fix regression from3e4bfff2. Co-Authored-by: Jin Bo <jinbo@loongson.cn> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com> (cherry picked from commit09856e4e48) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
483015d6ce
commit
1b08c6c95e
@@ -88,7 +88,7 @@ static int encode_write(AVCodecContext *avctx, AVFrame *frame, FILE *fout)
|
||||
enc_pkt->stream_index = 0;
|
||||
ret = fwrite(enc_pkt->data, enc_pkt->size, 1, fout);
|
||||
av_packet_unref(enc_pkt);
|
||||
if (ret != enc_pkt->size) {
|
||||
if (!ret) {
|
||||
ret = AVERROR(errno);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user