diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2012-05-23 22:45:03 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-05-24 00:25:35 +0300 |
commit | f645f1d6eadae8d67c832125186ad5b209e8ba03 (patch) | |
tree | c402455e81f4070b5b576fdb6e2e9f43ccd1c710 /libavformat/rtmppkt.c | |
parent | c7448c182a701b4c6efc52e0224bcbecc1aa6c3b (diff) | |
download | ffmpeg-f645f1d6eadae8d67c832125186ad5b209e8ba03.tar.gz |
rtmp: Check ff_rtmp_packet_create calls
Check malloc calls used by ff_rtmp_packet_create, unify error
handling and pass on error codes.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtmppkt.c')
-rw-r--r-- | libavformat/rtmppkt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c index 8c455a09f0..474f637c2b 100644 --- a/libavformat/rtmppkt.c +++ b/libavformat/rtmppkt.c @@ -79,6 +79,7 @@ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p, uint32_t extra = 0; enum RTMPPacketType type; int size = 0; + int ret; if (ffurl_read(h, &hdr, 1) != 1) return AVERROR(EIO); @@ -129,8 +130,9 @@ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p, if (hdr != RTMP_PS_TWELVEBYTES) timestamp += prev_pkt[channel_id].timestamp; - if (ff_rtmp_packet_create(p, channel_id, type, timestamp, data_size)) - return -1; + if ((ret = ff_rtmp_packet_create(p, channel_id, type, timestamp, + data_size)) < 0) + return ret; p->extra = extra; // save history prev_pkt[channel_id].channel_id = channel_id; |