Unified · Split
| @@ -823,7 +823,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) · 822 unmodified lines | ||
| 823 | 823 | { |
| 824 | 824 | AVFormatContext *s = nut->avf; |
| 825 | 825 | AVIOContext *bc = s->pb; |
| 826 | − int size, stream_id, discard; | |
| 826 | + int size, stream_id, discard, ret; | |
| 827 | 827 | int64_t pts, last_IP_pts; |
| 828 | 828 | StreamContext *stc; |
| 829 | 829 | uint8_t header_idx; |
| @@ -848,7 +848,9 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) · 18 unmodified lines | ||
| 848 | 848 | return 1; |
| 849 | 849 | } |
| 850 | 850 | |
| 851 | − av_new_packet(pkt, size + nut->header_len[header_idx]); | |
| 851 | + ret = av_new_packet(pkt, size + nut->header_len[header_idx]); | |
| 852 | + if (ret < 0) | |
| 853 | + return ret; | |
| 852 | 854 | memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]); |
| 853 | 855 | pkt->pos = avio_tell(bc); // FIXME |
| 854 | 856 | avio_read(bc, pkt->data + nut->header_len[header_idx], size); |