changeset 5399:f042e114451f libavformat

7l trocadero: reading right into enum variable may cause unwanted effects, use intermediate buffer for reading value instead in RTMP protocol handler.
author kostya
date Tue, 01 Dec 2009 14:58:17 +0000
parents e92aec1db0b9
children c7d1e90d4935
files rtmppkt.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rtmppkt.c	Tue Dec 01 13:17:10 2009 +0000
+++ b/rtmppkt.c	Tue Dec 01 14:58:17 2009 +0000
@@ -102,8 +102,9 @@
             if (url_read_complete(h, buf, 3) != 3)
                 return AVERROR(EIO);
             data_size = AV_RB24(buf);
-            if (url_read_complete(h, &type, 1) != 1)
+            if (url_read_complete(h, buf, 1) != 1)
                 return AVERROR(EIO);
+            type = buf[0];
             if (hdr == RTMP_PS_TWELVEBYTES) {
                 if (url_read_complete(h, buf, 4) != 4)
                     return AVERROR(EIO);