]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/a64.c
Merge commit '6d212599aa684f30511fb08ca30fe2378405304e'
[ffmpeg] / libavformat / a64.c
index 786c75cc905ca3c493bf859a6fa1cc6ecaf36671..802235f404a9b50aee0f39b5a57019681094611b 100644 (file)
@@ -24,7 +24,7 @@
 #include "avformat.h"
 #include "rawenc.h"
 
-static int a64_write_header(struct AVFormatContext *s)
+static int a64_write_header(AVFormatContext *s)
 {
     AVCodecContext *avctx = s->streams[0]->codec;
     uint8_t header[5] = {
@@ -34,6 +34,12 @@ static int a64_write_header(struct AVFormatContext *s)
         0x00, //charset_lifetime (multi only)
         0x00  //fps in 50/fps;
     };
+
+    if (avctx->extradata_size < 4) {
+        av_log(s, AV_LOG_ERROR, "Missing extradata\n");
+        return AVERROR(EINVAL);
+    }
+
     switch (avctx->codec->id) {
     case AV_CODEC_ID_A64_MULTI:
         header[2] = 0x00;