Commit 284b4326 authored by Timo Rothenpieler's avatar Timo Rothenpieler

avformat/fitsenc: validate input pixel format

Fixes CID #1416961 and #1416962
parent 237ccd8a
...@@ -106,6 +106,8 @@ static int write_image_header(AVFormatContext *s) ...@@ -106,6 +106,8 @@ static int write_image_header(AVFormatContext *s)
} }
bzero = 32768; bzero = 32768;
break; break;
default:
return AVERROR(EINVAL);
} }
if (fitsctx->first_image) { if (fitsctx->first_image) {
...@@ -166,7 +168,9 @@ static int write_image_header(AVFormatContext *s) ...@@ -166,7 +168,9 @@ static int write_image_header(AVFormatContext *s)
static int fits_write_packet(AVFormatContext *s, AVPacket *pkt) 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); avio_write(s->pb, pkt->data, pkt->size);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment