FrameBuffer *buf;
int ret, i;
- if (!ist->buffer_pool && (ret = alloc_buffer(s, ist, &ist->buffer_pool)) < 0)
+ if(av_image_check_size(s->width, s->height, 0, s) || s->pix_fmt<0)
+ return -1;
+
+ if (!ist->buffer_pool && (ret = alloc_buffer(ist, s, &ist->buffer_pool)) < 0)
return ret;
buf = ist->buffer_pool;
if (buf->w != s->width || buf->h != s->height || buf->pix_fmt != s->pix_fmt) {
av_freep(&buf->base[0]);
av_free(buf);
- if ((ret = alloc_buffer(s, ist, &buf)) < 0)
+ ist->dr1 = 0;
+ if ((ret = alloc_buffer(ist, s, &buf)) < 0)
return ret;
}
buf->refcount++;
}
pic->extended_data = pic->data;
avci->buffer_count++;
+ pic->width = buf->width;
+ pic->height = buf->height;
+ pic->format = buf->pix_fmt;
+ pic->sample_aspect_ratio = s->sample_aspect_ratio;
- if(s->pkt) pic->pkt_pts= s->pkt->pts;
- else pic->pkt_pts= AV_NOPTS_VALUE;
+ if (s->pkt) {
+ pic->pkt_pts = s->pkt->pts;
+ pic->pkt_pos = s->pkt->pos;
+ } else {
+ pic->pkt_pts = AV_NOPTS_VALUE;
+ pic->pkt_pos = -1;
+ }
pic->reordered_opaque= s->reordered_opaque;
+ pic->sample_aspect_ratio = s->sample_aspect_ratio;
+ pic->width = s->width;
+ pic->height = s->height;
+ pic->format = s->pix_fmt;
if(s->debug&FF_DEBUG_BUFFERS)
av_log(s, AV_LOG_DEBUG, "default_get_buffer called on pic %p, %d "