Browse Source

avformat/fitsenc: validate input pixel format

Fixes CID #1416961 and #1416962
tags/n4.0
Timo Rothenpieler 8 years ago
parent
commit
284b432662
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavformat/fitsenc.c

+ 5
- 1
libavformat/fitsenc.c View File

@@ -106,6 +106,8 @@ static int write_image_header(AVFormatContext *s)
}
bzero = 32768;
break;
default:
return AVERROR(EINVAL);
}

if (fitsctx->first_image) {
@@ -166,7 +168,9 @@ static int write_image_header(AVFormatContext *s)

static int fits_write_packet(AVFormatContext *s, AVPacket *pkt)
{
write_image_header(s);
int ret = write_image_header(s);
if (ret < 0)
return ret;
avio_write(s->pb, pkt->data, pkt->size);
return 0;
}


Loading…
Cancel
Save