Merge commit '84bf64d3598c98a748e609195358ea04b0cfd140'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 29 Oct 2014 21:21:49 +0000 (22:21 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 29 Oct 2014 21:47:11 +0000 (22:47 +0100)
* commit '84bf64d3598c98a748e609195358ea04b0cfd140':
  bethsoftvid: simplify return handling

See: 5ee6527c4386c76a0aae1b07842d6676ee1e91d1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/bethsoftvid.c

@@@ -192,11 -188,11 +191,13 @@@ static int read_frame(BVID_DemuxContex
      if (vid->palette) {
          uint8_t *pdata = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
                                                   BVID_PALETTE_SIZE);
-         if (pdata)
-             memcpy(pdata, vid->palette, BVID_PALETTE_SIZE);
-         else
+         if (!pdata) {
+             ret = AVERROR(ENOMEM);
 +            av_log(s, AV_LOG_ERROR, "Failed to allocate palette side data\n");
+             goto fail;
+         }
+         memcpy(pdata, vid->palette, BVID_PALETTE_SIZE);
 +
          av_freep(&vid->palette);
      }