[pulseaudio-discuss] [PATCH] module-rtp-recv: fix crash on empty UDP packets
Alexander E. Patrakov
patrakov at gmail.com
Thu Jun 5 04:16:19 PDT 2014
05.06.2014 17:13, Tanu Kaskinen пишет:
> On Sat, 2014-05-31 at 23:48 +0600, Alexander E. Patrakov wrote:
>> Signed-off-by: Alexander E. Patrakov <patrakov at gmail.com>
>>
>> ---
>> src/modules/rtp/rtp.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/modules/rtp/rtp.c b/src/modules/rtp/rtp.c
>> index 570737e..8451386 100644
>> --- a/src/modules/rtp/rtp.c
>> +++ b/src/modules/rtp/rtp.c
>> @@ -183,7 +183,7 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool, struct
>> }
>>
>> if (size <= 0)
>> - return 0;
>> + size = 1; /* invalid or empty packet, let the recvfrom() or size check fail */
>
> I suppose you mean recvmsg(), not recvfrom()?
Yes, sorry.
> I think it would be good to explain the logic a bit more in the comment.
> It may not be obvious to the reader why we don't just return -1 here.
I will send an updated patch later today.
--
Alexander E. Patrakov
More information about the pulseaudio-discuss
mailing list