Commit 42316907 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'af7ca6ea'

* commit 'af7ca6ea':
  nutdec: check av_new_packet return value

Conflicts:
	libavformat/nutdec.c

See: bb502411Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents dd3f1563 af7ca6ea
...@@ -994,11 +994,10 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) ...@@ -994,11 +994,10 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
{ {
AVFormatContext *s = nut->avf; AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb; AVIOContext *bc = s->pb;
int size, stream_id, discard; int size, stream_id, discard, ret;
int64_t pts, last_IP_pts; int64_t pts, last_IP_pts;
StreamContext *stc; StreamContext *stc;
uint8_t header_idx; uint8_t header_idx;
int ret;
size = decode_frame_header(nut, &pts, &stream_id, &header_idx, frame_code); size = decode_frame_header(nut, &pts, &stream_id, &header_idx, frame_code);
if (size < 0) if (size < 0)
...@@ -1020,8 +1019,9 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) ...@@ -1020,8 +1019,9 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
return 1; return 1;
} }
if (av_new_packet(pkt, size + nut->header_len[header_idx]) < 0) ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
return AVERROR(ENOMEM); if (ret < 0)
return ret;
memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]); memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
pkt->pos = avio_tell(bc); // FIXME pkt->pos = avio_tell(bc); // FIXME
if (stc->last_flags & FLAG_SM_DATA) { if (stc->last_flags & FLAG_SM_DATA) {
......
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