diff mbox

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

Message ID 20171017221159.2349-5-sw@jkqxz.net
State New
Headers show

Commit Message

Mark Thompson Oct. 17, 2017, 10:11 p.m. UTC
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(-)

Comments

Michael Niedermayer Oct. 19, 2017, 12:07 a.m. UTC | #1
On Tue, Oct 17, 2017 at 11:11:57PM +0100, Mark Thompson wrote:
> 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(-)

LGTM

thx

[...]
diff mbox

Patch

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)