mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/fitsenc: validate input pixel format
Fixes CID #1416961 and #1416962
This commit is contained in:
parent
237ccd8a16
commit
284b432662
@ -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…
Reference in New Issue
Block a user