On Fri, Dec 12, 2014 at 11:32 AM, Luca Barbato <[email protected]> wrote:
> On 12/12/14 04:35, Vittorio Giovara wrote:
>> Signed-off-by: Vittorio Giovara <[email protected]>
>> ---
>> Blame j-b.
>> Vittorio
>>
>>  libavcodec/vp3.c | 52 +++++++++++++++++++++++++++++++++++++---------------
>>  1 file changed, 37 insertions(+), 15 deletions(-)
>>
>> diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
>> -    vp3_draw_horiz_band(s, s->avctx->height);
>> +    vp3_draw_horiz_band(s, s->height);
>>
>> +    /* output frame, offset as needed */
>>      if ((ret = av_frame_ref(data, s->current_frame.f)) < 0)
>>          return ret;
>> +    for (i = 0; i < 3; i++) {
>> +        AVFrame *dst = data;
>> +        int off = (s->offset_x >> (i && s->chroma_y_shift)) +
>> +                  (s->offset_y >> (i && s->chroma_y_shift)) * 
>> dst->linesize[i];
>
> are we sure it won't get over the buffer? (are the offsets validated
> somewhere?).

Actually no, I'll add a check for it.

>> +        dst->data[i] += off;
>> +    }
>>      *got_frame = 1;
>>
>>      if (!HAVE_THREADS || !(s->avctx->active_thread_type & FF_THREAD_FRAME)) 
>> {
>> @@ -2259,16 +2268,29 @@ static int theora_decode_header(AVCodecContext 
>> *avctx, GetBitContext *gb)
>>          skip_bits(gb, 3); /* reserved */
>>      }
>>
>> -//    align_get_bits(gb);
>> -
>> -    if (visible_width  <= s->width  && visible_width  > s->width  - 16 &&
>> -        visible_height <= s->height && visible_height > s->height - 16 &&
>> -        !offset_x && (offset_y == s->height - visible_height))
>> -        ret = ff_set_dimensions(avctx, visible_width, visible_height);
>> -    else
>> -        ret = ff_set_dimensions(avctx, s->width, s->height);
>
>
> Is that enough?

What do you mean? Right now s->width and s->height contain the full
frame size, so context width/height and coded_w/h gets initialized
correctly.

-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to