[FFmpeg-cvslog] h264_sei: Group error check outside the switch block

Vittorio Giovara git at videolan.org
Tue Jun 30 22:36:31 CEST 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Sun Jun 28 02:05:04 2015 +0200| [0bfab80a0d9fce0180e8aa2a947267f89b725091] | committer: Vittorio Giovara

h264_sei: Group error check outside the switch block

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0bfab80a0d9fce0180e8aa2a947267f89b725091
---

 libavcodec/h264_sei.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index 52ff2ff..0e99f05 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -246,38 +246,28 @@ int ff_h264_decode_sei(H264Context *h)
         switch (type) {
         case SEI_TYPE_PIC_TIMING: // Picture timing SEI
             ret = decode_picture_timing(h);
-            if (ret < 0)
-                return ret;
             break;
         case SEI_TYPE_USER_DATA_UNREGISTERED:
             ret = decode_unregistered_user_data(h, size);
-            if (ret < 0)
-                return ret;
             break;
         case SEI_TYPE_RECOVERY_POINT:
             ret = decode_recovery_point(h);
-            if (ret < 0)
-                return ret;
             break;
         case SEI_TYPE_BUFFERING_PERIOD:
             ret = decode_buffering_period(h);
-            if (ret < 0)
-                return ret;
             break;
         case SEI_TYPE_FRAME_PACKING:
             ret = decode_frame_packing_arrangement(h);
-            if (ret < 0)
-                return ret;
             break;
         case SEI_TYPE_DISPLAY_ORIENTATION:
             ret = decode_display_orientation(h);
-            if (ret < 0)
-                return ret;
             break;
         default:
             av_log(h->avctx, AV_LOG_DEBUG, "unknown SEI type %d\n", type);
             skip_bits(&h->gb, 8 * size);
         }
+        if (ret < 0)
+            return ret;
 
         // FIXME check bits here
         align_get_bits(&h->gb);



More information about the ffmpeg-cvslog mailing list