summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-08-05 14:08:28 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-08-05 14:08:28 +0000
commit6e23091277e17e80bc3f63091584aa290d081c21 (patch)
tree2246724529456e7a852b2b5671da114a1ba8d577 /libavcodec
parent59c673d5180cd85f367df0badf435f09513a5947 (diff)
check input pix_fmt
Originally committed as revision 2104 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 4ccc7d571a..91b46b2b68 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1364,7 +1364,6 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
// empty
}else{
int h_chroma_shift, v_chroma_shift;
-
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift);
for(i=0; i<3; i++){
@@ -1548,6 +1547,11 @@ int MPV_encode_picture(AVCodecContext *avctx,
AVFrame *pic_arg = data;
int i;
+ if(avctx->pix_fmt != PIX_FMT_YUV420P){
+ fprintf(stderr, "this codec supports only YUV420P\n");
+ return -1;
+ }
+
init_put_bits(&s->pb, buf, buf_size, NULL, NULL);
s->picture_in_gop_number++;