1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

doc/examples/vaapi_encode: Try to check fwrite() for failure

Fixes: CID1604548 Unused value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e4bfff211)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-07-02 01:47:33 +02:00
parent 2528ab4895
commit 16a0e979e7
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -91,6 +91,10 @@ 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) {
ret = AVERROR(errno);
break;
}
}
end: