mirror of
https://github.com/Genymobile/scrcpy
synced 2025-01-18 05:01:00 +00:00
Fix double-free on error
If writing the recording header fails, do not clean the resources immediately to avoid double-free.
This commit is contained in:
parent
4961256123
commit
3c55d0c69b
@ -151,9 +151,6 @@ recorder_write_header(struct recorder *recorder, const AVPacket *packet) {
|
||||
int ret = avformat_write_header(recorder->ctx, NULL);
|
||||
if (ret < 0) {
|
||||
LOGE("Failed to write header to %s", recorder->filename);
|
||||
SDL_free(extradata);
|
||||
avio_closep(&recorder->ctx->pb);
|
||||
avformat_free_context(recorder->ctx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user