Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-07 Thread Samuel Pitoiset
On Thu, Aug 2, 2012 at 4:11 PM, Samuel Pitoiset samuel.pitoi...@gmail.com wrote: --- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 1341cd7..c130b2b 100644 --- a/libavformat/rtmpproto.c

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-07 Thread Jordi Ortiz
-//TODO: check for the messages sent for wrong state? +if (pkt-data[0] != AMF_DATA_TYPE_STRING) { +av_log(s, AV_LOG_ERROR, No string method found in invoke packet\n); +return AVERROR_INVALIDDATA; +} + May be you could use the ff_amf_read_string() =)

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-07 Thread Martin Storsjö
On Thu, 2 Aug 2012, Samuel Pitoiset wrote: --- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 1341cd7..c130b2b 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -1033,7

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-07 Thread Martin Storsjö
On Tue, 7 Aug 2012, Martin Storsjö wrote: On Thu, 2 Aug 2012, Samuel Pitoiset wrote: --- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 1341cd7..c130b2b 100644 ---

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-07 Thread Martin Storsjö
On Tue, 7 Aug 2012, Martin Storsjö wrote: On Thu, 2 Aug 2012, Samuel Pitoiset wrote: --- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 1341cd7..c130b2b 100644 ---

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-07 Thread Samuel Pitoiset
On Tue, Aug 7, 2012 at 10:03 PM, Martin Storsjö mar...@martin.st wrote: On Tue, 7 Aug 2012, Martin Storsjö wrote: On Thu, 2 Aug 2012, Samuel Pitoiset wrote: --- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c

[libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-02 Thread Samuel Pitoiset
--- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 1341cd7..c130b2b 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -1033,7 +1033,11 @@ static int

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-01 Thread Samuel Pitoiset
On Wed, Aug 1, 2012 at 12:34 AM, Derek Buitenhuis derek.buitenh...@gmail.com wrote: On 31/07/2012 12:17 PM, Samuel Pitoiset wrote: +if (memcmp(pkt-data, \002, 1)) { +av_log(s, AV_LOG_ERROR, No string method found in invoke packet\n); +return AVERROR_INVALIDDATA; +}

[libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-01 Thread Samuel Pitoiset
--- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 6044425..8c0ecb2 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -1038,7 +1038,11 @@ static int

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-01 Thread Derek Buitenhuis
On 01/08/2012 6:13 AM, Samuel Pitoiset wrote: --- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) Looks OK, but I have no idea where the magic numbers come from for this or the lines following it. Perhaps you can add comments in a separate patch? - Derek

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-01 Thread Samuel Pitoiset
On Wed, Aug 1, 2012 at 6:09 PM, Derek Buitenhuis derek.buitenh...@gmail.com wrote: On 01/08/2012 6:13 AM, Samuel Pitoiset wrote: --- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) Looks OK, but I have no idea where the magic numbers come from for this or

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-01 Thread Derek Buitenhuis
On 01/08/2012 12:27 PM, Samuel Pitoiset wrote: 0x02 is a magic number defined in the rtmp specification which indicates that data is string. I don't think a comment is needed here because it's already specified in the error message. OK. - Derek ___

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-01 Thread Luca Barbato
On 01/08/12 12:13, Samuel Pitoiset wrote: --- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 6044425..8c0ecb2 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-08-01 Thread Luca Barbato
On 01/08/12 22:44, Luca Barbato wrote: On 01/08/12 12:13, Samuel Pitoiset wrote: --- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 6044425..8c0ecb2 100644 ---

[libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-07-31 Thread Samuel Pitoiset
--- libavformat/rtmpproto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 7a00b92..26b617d 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -1038,7 +1038,11 @@ static int

Re: [libav-devel] [PATCH 2/2] rtmp: Prevent handling of an incorrect invoke packet

2012-07-31 Thread Derek Buitenhuis
On 31/07/2012 12:17 PM, Samuel Pitoiset wrote: +if (memcmp(pkt-data, \002, 1)) { +av_log(s, AV_LOG_ERROR, No string method found in invoke packet\n); +return AVERROR_INVALIDDATA; +} Can you not just compare pkt-data[0] instead of using memcmp? - Derek