[FFmpeg-devel] avformat/http: use assignment of structure instead of memcpy

Submitted by Zhao Zhili on Oct. 17, 2017, 4:19 p.m.

Details

Message ID 20171017161937.60537-1-quinkblack@foxmail.com
State New
Headers show

Commit Message

Zhao Zhili Oct. 17, 2017, 4:19 p.m.
---
 libavformat/http.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavformat/http.c b/libavformat/http.c
index 668cd51986..63dfd51117 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -173,12 +173,10 @@  static int http_read_header(URLContext *h, int *new_location);
 
 void ff_http_init_auth_state(URLContext *dest, const URLContext *src)
 {
-    memcpy(&((HTTPContext *)dest->priv_data)->auth_state,
-           &((HTTPContext *)src->priv_data)->auth_state,
-           sizeof(HTTPAuthState));
-    memcpy(&((HTTPContext *)dest->priv_data)->proxy_auth_state,
-           &((HTTPContext *)src->priv_data)->proxy_auth_state,
-           sizeof(HTTPAuthState));
+    HTTPContext *d = dest->priv_data;
+    HTTPContext *s = src->priv_data;
+    d->auth_state = s->auth_state;
+    d->proxy_auth_state = s->proxy_auth_state;
 }
 
 static int http_open_cnx_internal(URLContext *h, AVDictionary **options)