[FFmpeg-devel] [PATCH 5/7] mxfdec: Fix return value check

Mark Thompson sw at jkqxz.net
Wed Oct 18 01:11:57 EEST 2017


Move the assignment out of the condition, because that was hiding the error.

Fixes #6750.
---
 libavformat/mxfdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 118e3e40b4..e4019ac0a7 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2311,7 +2311,8 @@ static int64_t mxf_timestamp_to_int64(uint64_t timestamp)
 
 #define SET_TS_METADATA(pb, name, var, str) do { \
     var = avio_rb64(pb); \
-    if ((ret = avpriv_dict_set_timestamp(&s->metadata, name, mxf_timestamp_to_int64(var)) < 0)) \
+    ret = avpriv_dict_set_timestamp(&s->metadata, name, mxf_timestamp_to_int64(var)); \
+    if (ret < 0) \
         return ret; \
 } while (0)
 
-- 
2.11.0



More information about the ffmpeg-devel mailing list