[FFmpeg-cvslog] rtpdec: Check the return value from av_new_packet

Martin Storsjö git at videolan.org
Mon Jan 21 15:00:05 CET 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sun Jan 20 18:31:57 2013 +0200| [a76bc3bc44e3bcd6a0923e65cd669e71e9819388] | committer: Martin Storsjö

rtpdec: Check the return value from av_new_packet

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a76bc3bc44e3bcd6a0923e65cd669e71e9819388
---

 libavformat/rtpdec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 4379e6f..a818887 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -635,7 +635,8 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
     } else if (st) {
         /* At this point, the RTP header has been stripped;
          * This is ASSUMING that there is only 1 CSRC, which isn't wise. */
-        av_new_packet(pkt, len);
+        if ((rv = av_new_packet(pkt, len)) < 0)
+            return rv;
         memcpy(pkt->data, buf, len);
         pkt->stream_index = st->index;
     } else {



More information about the ffmpeg-cvslog mailing list