Commit 7aa0118c authored by Josh Allmann's avatar Josh Allmann Committed by Martin Storsjö

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
parent 016bc031
...@@ -69,7 +69,7 @@ struct PayloadContext { ...@@ -69,7 +69,7 @@ struct PayloadContext {
#define DEAD_COOKIE (0xdeaddead) ///< Cookie for the extradata; once it is freed. #define DEAD_COOKIE (0xdeaddead) ///< Cookie for the extradata; once it is freed.
/* ---------------- private code */ /* ---------------- private code */
static void sdp_parse_fmtp_config_h264(AVStream * stream, static int sdp_parse_fmtp_config_h264(AVStream * stream,
PayloadContext * h264_data, PayloadContext * h264_data,
char *attr, char *value) char *attr, char *value)
{ {
...@@ -155,11 +155,13 @@ static void sdp_parse_fmtp_config_h264(AVStream * stream, ...@@ -155,11 +155,13 @@ static void sdp_parse_fmtp_config_h264(AVStream * stream,
codec->extradata_size+= sizeof(start_sequence)+packet_size; codec->extradata_size+= sizeof(start_sequence)+packet_size;
} else { } else {
av_log(codec, AV_LOG_ERROR, "Unable to allocate memory for extradata!"); 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); 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... // return 0 on packet, no more left, 1 on packet, 1 on partial packet...
......
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