Browse Source

a64: check that extradata exists before reading from it

tags/n2.3
Anton Khirnov 11 years ago
parent
commit
3ef6c5264b
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavformat/a64.c

+ 6
- 0
libavformat/a64.c View File

@@ -35,6 +35,12 @@ static int a64_write_header(AVFormatContext *s)
0x00, //charset_lifetime (multi only) 0x00, //charset_lifetime (multi only)
0x00 //fps in 50/fps; 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) { switch (avctx->codec->id) {
case AV_CODEC_ID_A64_MULTI: case AV_CODEC_ID_A64_MULTI:
header[2] = 0x00; header[2] = 0x00;


Loading…
Cancel
Save