diff options
Diffstat (limited to 'libavcodec/flvdec.c')
-rw-r--r-- | libavcodec/flvdec.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c index 3405058bca..3b048f666d 100644 --- a/libavcodec/flvdec.c +++ b/libavcodec/flvdec.c @@ -1,19 +1,19 @@ /* * FLV decoding. - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -41,12 +41,12 @@ int ff_flv_decode_picture_header(MpegEncContext *s) /* picture header */ if (get_bits_long(&s->gb, 17) != 1) { av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n"); - return -1; + return AVERROR_INVALIDDATA; } format = get_bits(&s->gb, 5); if (format != 0 && format != 1) { av_log(s->avctx, AV_LOG_ERROR, "Bad picture format\n"); - return -1; + return AVERROR_INVALIDDATA; } s->h263_flv = format + 1; s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */ @@ -85,7 +85,7 @@ int ff_flv_decode_picture_header(MpegEncContext *s) break; } if (av_image_check_size(width, height, 0, s->avctx)) - return -1; + return AVERROR(EINVAL); s->width = width; s->height = height; @@ -103,10 +103,14 @@ int ff_flv_decode_picture_header(MpegEncContext *s) s->h263_long_vectors = 0; /* PEI */ - while (get_bits1(&s->gb) != 0) - skip_bits(&s->gb, 8); + if (skip_1stop_8data_bits(&s->gb) < 0) + return AVERROR_INVALIDDATA; + s->f_code = 1; + if (s->ehc_mode) + s->avctx->sample_aspect_ratio= (AVRational){1,2}; + if (s->avctx->debug & FF_DEBUG_PICT_INFO) { av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n", s->droppable ? 'D' : av_get_picture_type_char(s->pict_type), @@ -128,6 +132,7 @@ AVCodec ff_flv_decoder = { .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1, + .max_lowres = 3, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE |