aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpdec_h264.c
diff options
context:
space:
mode:
authorJosh Allmann <joshua.allmann@gmail.com>2010-06-28 11:25:39 +0000
committerMartin Storsjö <martin@martin.st>2010-06-28 11:25:39 +0000
commit7aa0118c46c8746dae5b3a7286e7b3199d358752 (patch)
tree31ebdfb1d448024ee5f63eeb8130140879444f40 /libavformat/rtpdec_h264.c
parent016bc031ebe5c3e75809749a3f409f9f2c4a1d7a (diff)
downloadffmpeg-7aa0118c46c8746dae5b3a7286e7b3199d358752.tar.gz
rtpdec: Return ENOMEM if H.264 RTP fails to allocate memory for SDP extradata
Patch by Josh Allmann, joshua dot allmann at gmail Originally committed as revision 23848 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec_h264.c')
-rw-r--r--libavformat/rtpdec_h264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 49db08a456..a6e0de8590 100644
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -69,7 +69,7 @@ struct PayloadContext {
#define DEAD_COOKIE (0xdeaddead) ///< Cookie for the extradata; once it is freed.
/* ---------------- private code */
-static void sdp_parse_fmtp_config_h264(AVStream * stream,
+static int sdp_parse_fmtp_config_h264(AVStream * stream,
PayloadContext * h264_data,
char *attr, char *value)
{
@@ -155,11 +155,13 @@ static void sdp_parse_fmtp_config_h264(AVStream * stream,
codec->extradata_size+= sizeof(start_sequence)+packet_size;
} else {
av_log(codec, AV_LOG_ERROR, "Unable to allocate memory for extradata!");
+ return AVERROR(ENOMEM);
}
}
}
av_log(codec, AV_LOG_DEBUG, "Extradata set to %p (size: %d)!", codec->extradata, codec->extradata_size);
}
+ return 0;
}
// return 0 on packet, no more left, 1 on packet, 1 on partial packet...