From 58e4823f685c7eaa471e80f2624104757919fa17 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 23 Jan 2018 07:57:52 -0500 Subject: [PATCH] Bug1829, more: detect out-of-space when writing FFmpeg formats --- src/FFmpeg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FFmpeg.cpp b/src/FFmpeg.cpp index 380070004..3c4c0e706 100644 --- a/src/FFmpeg.cpp +++ b/src/FFmpeg.cpp @@ -176,7 +176,10 @@ static int ufile_read(void *opaque, uint8_t *buf, int size) static int ufile_write(void *opaque, uint8_t *buf, int size) { - return (int) ((wxFile *) opaque)->Write(buf, size); + auto bytes = (int) ((wxFile *) opaque)->Write(buf, size); + if (bytes != size) + return -ENOSPC; + return bytes; } static int64_t ufile_seek(void *opaque, int64_t pos, int whence)