[FFmpeg-trac] #6750(avformat:new): ffmpeg-3.4/libavformat/mxfdec.c:2340]: (style) Suspicious condition

FFmpeg trac at avcodec.org
Tue Oct 17 12:39:23 EEST 2017


#6750: ffmpeg-3.4/libavformat/mxfdec.c:2340]: (style) Suspicious condition
----------------------------------+---------------------------------------
             Reporter:  dcb       |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  avformat  |                  Version:  unspecified
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+---------------------------------------
 ffmpeg-3.4/libavformat/mxfdec.c:2340]: (style) Suspicious condition
 (assignment + comparison); Clarify expression with parentheses.

 Source code is

        SET_TS_METADATA(pb, "modification_date", ts, str);

 but

 #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)) \
         return ret; \
 } while (0)

 maybe better code

 #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) \
         return ret; \
 } while (0)

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6750>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list