diff options
Diffstat (limited to 'ffmpeg/libavformat/ffmdec.c')
| -rw-r--r-- | ffmpeg/libavformat/ffmdec.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ffmpeg/libavformat/ffmdec.c b/ffmpeg/libavformat/ffmdec.c index 02cf790..9d89b16 100644 --- a/ffmpeg/libavformat/ffmdec.c +++ b/ffmpeg/libavformat/ffmdec.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <stdint.h> + #include "libavutil/intreadwrite.h" #include "libavutil/intfloat.h" #include "avformat.h" @@ -278,11 +280,8 @@ static int ffm2_read_header(AVFormatContext *s) codec->flags2 = avio_rb32(pb); codec->debug = avio_rb32(pb); if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) { - codec->extradata_size = avio_rb32(pb); - codec->extradata = av_malloc(codec->extradata_size); - if (!codec->extradata) + if (ff_get_extradata(codec, pb, avio_rb32(pb)) < 0) return AVERROR(ENOMEM); - avio_read(pb, codec->extradata, codec->extradata_size); } avio_seek(pb, next, SEEK_SET); id = avio_rb32(pb); @@ -468,11 +467,8 @@ static int ffm_read_header(AVFormatContext *s) goto fail; } if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) { - codec->extradata_size = avio_rb32(pb); - codec->extradata = av_malloc(codec->extradata_size); - if (!codec->extradata) + if (ff_get_extradata(codec, pb, avio_rb32(pb)) < 0) return AVERROR(ENOMEM); - avio_read(pb, codec->extradata, codec->extradata_size); } } |
