aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-10-20 14:11:19 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-21 14:37:48 +0100
commitaf7ca6ea124b82b337a6b96e10963e88eba57ebe (patch)
tree900ae08cc327f5c28b288328fedf6792914eaa77
parentb69183f65d0f6f4cd7a4e6c0deb57d59b0185aba (diff)
downloadffmpeg-af7ca6ea124b82b337a6b96e10963e88eba57ebe.tar.gz
nutdec: check av_new_packet return value
CC: libav-stable@libav.org Bug-Id: CID 733713
-rw-r--r--libavformat/nutdec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 56d208fcc8..c3f5f4ba79 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -823,7 +823,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
{
AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb;
- int size, stream_id, discard;
+ int size, stream_id, discard, ret;
int64_t pts, last_IP_pts;
StreamContext *stc;
uint8_t header_idx;
@@ -848,7 +848,9 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
return 1;
}
- av_new_packet(pkt, size + nut->header_len[header_idx]);
+ ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
+ if (ret < 0)
+ return ret;
memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
pkt->pos = avio_tell(bc); // FIXME
avio_read(bc, pkt->data + nut->header_len[header_idx], size);