[FFmpeg-cvslog] Merge commit 'f4ca8ea92a8b36fe723412aefafc1b2fa89f8dc6'

Clément Bœsch git at videolan.org
Wed Mar 29 16:19:06 EEST 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Wed Mar 29 15:17:59 2017 +0200| [72dbfe42efcb0e0c397ec879c7868861083c5286] | committer: Clément Bœsch

Merge commit 'f4ca8ea92a8b36fe723412aefafc1b2fa89f8dc6'

* commit 'f4ca8ea92a8b36fe723412aefafc1b2fa89f8dc6':
  rtmpproto: Restructure zlib code to avoid unreachable code warning

Merged-by: Clément Bœsch <u at pkh.me>

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

 libavformat/rtmpproto.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index aa1cd8f..d415f0f 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -1140,7 +1140,7 @@ static int rtmp_calc_swfhash(URLContext *s)
 {
     RTMPContext *rt = s->priv_data;
     uint8_t *in_data = NULL, *out_data = NULL, *swfdata;
-    int64_t in_size, out_size;
+    int64_t in_size;
     URLContext *stream;
     char swfhash[32];
     int swfsize;
@@ -1173,6 +1173,8 @@ static int rtmp_calc_swfhash(URLContext *s)
     }
 
     if (!memcmp(in_data, "CWS", 3)) {
+#if CONFIG_ZLIB
+        int64_t out_size;
         /* Decompress the SWF player file using Zlib. */
         if (!(out_data = av_malloc(8))) {
             ret = AVERROR(ENOMEM);
@@ -1182,18 +1184,17 @@ static int rtmp_calc_swfhash(URLContext *s)
         memcpy(out_data, in_data, 8);
         out_size = 8;
 
-#if CONFIG_ZLIB
         if ((ret = rtmp_uncompress_swfplayer(in_data + 8, in_size - 8,
                                              &out_data, &out_size)) < 0)
             goto fail;
+        swfsize = out_size;
+        swfdata = out_data;
 #else
         av_log(s, AV_LOG_ERROR,
                "Zlib is required for decompressing the SWF player file.\n");
         ret = AVERROR(EINVAL);
         goto fail;
 #endif
-        swfsize = out_size;
-        swfdata = out_data;
     } else {
         swfsize = in_size;
         swfdata = in_data;


======================================================================




More information about the ffmpeg-cvslog mailing list