Merge commit 'bc1eace1b3654c490cb2c226b3c80854244dbb9a'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 8 Jun 2015 20:48:14 +0000 (22:48 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 8 Jun 2015 20:48:14 +0000 (22:48 +0200)
* commit 'bc1eace1b3654c490cb2c226b3c80854244dbb9a':
  jack: Check memory allocation

Conflicts:
libavdevice/jack.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavdevice/jack.c

@@@ -197,9 -199,13 +197,13 @@@ static int start_jack(AVFormatContext *
      }
  
      /* Create FIFO buffers */
 -    self->filled_pkts = av_fifo_alloc(FIFO_PACKETS_NUM * sizeof(AVPacket));
 +    self->filled_pkts = av_fifo_alloc_array(FIFO_PACKETS_NUM, sizeof(AVPacket));
      /* New packets FIFO with one extra packet for safety against underruns */
 -    self->new_pkts    = av_fifo_alloc((FIFO_PACKETS_NUM + 1) * sizeof(AVPacket));
 +    self->new_pkts    = av_fifo_alloc_array((FIFO_PACKETS_NUM + 1), sizeof(AVPacket));
+     if (!self->new_pkts) {
+         jack_client_close(self->client);
+         return AVERROR(ENOMEM);
+     }
      if ((test = supply_new_packets(self, context))) {
          jack_client_close(self->client);
          return test;