Commit 15796932 authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit '22cc57da'

* commit '22cc57da':
  rtpdec: Forward the memory failure
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents d36eac69 22cc57da
...@@ -691,7 +691,7 @@ void ff_rtp_reset_packet_queue(RTPDemuxContext *s) ...@@ -691,7 +691,7 @@ void ff_rtp_reset_packet_queue(RTPDemuxContext *s)
s->prev_ret = 0; s->prev_ret = 0;
} }
static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len) static int enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len)
{ {
uint16_t seq = AV_RB16(buf + 2); uint16_t seq = AV_RB16(buf + 2);
RTPPacket **cur = &s->queue, *packet; RTPPacket **cur = &s->queue, *packet;
...@@ -706,7 +706,7 @@ static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len) ...@@ -706,7 +706,7 @@ static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len)
packet = av_mallocz(sizeof(*packet)); packet = av_mallocz(sizeof(*packet));
if (!packet) if (!packet)
return; return AVERROR(ENOMEM);
packet->recvtime = av_gettime_relative(); packet->recvtime = av_gettime_relative();
packet->seq = seq; packet->seq = seq;
packet->len = len; packet->len = len;
...@@ -714,6 +714,8 @@ static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len) ...@@ -714,6 +714,8 @@ static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len)
packet->next = *cur; packet->next = *cur;
*cur = packet; *cur = packet;
s->queue_len++; s->queue_len++;
return 0;
} }
static int has_next_packet(RTPDemuxContext *s) static int has_next_packet(RTPDemuxContext *s)
...@@ -811,7 +813,9 @@ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt, ...@@ -811,7 +813,9 @@ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
return rv; return rv;
} else { } else {
/* Still missing some packet, enqueue this one. */ /* Still missing some packet, enqueue this one. */
enqueue_packet(s, buf, len); rv = enqueue_packet(s, buf, len);
if (rv < 0)
return rv;
*bufptr = NULL; *bufptr = NULL;
/* Return the first enqueued packet if the queue is full, /* Return the first enqueued packet if the queue is full,
* even if we're missing something */ * even if we're missing something */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment