mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
Fixed openjpeg decoding bug with width/linesize issue
The original code wasn't taking into account the fact that linesize may not equal the frame's width. This is to correct that. Signed-off-by: Michael Bradshaw <mbradshaw@sorensonmedia.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
69d766daa0
commit
d1669e5fe3
@ -139,8 +139,8 @@ static inline void libopenjpeg_copyto8(AVFrame *picture, opj_image_t *image) {
|
||||
|
||||
for(index = 0; index < image->numcomps; index++) {
|
||||
comp_data = image->comps[index].data;
|
||||
img_ptr = picture->data[index];
|
||||
for(y = 0; y < image->comps[index].h; y++) {
|
||||
img_ptr = picture->data[index] + y * picture->linesize[index];
|
||||
for(x = 0; x < image->comps[index].w; x++) {
|
||||
*img_ptr = (uint8_t) *comp_data;
|
||||
img_ptr++;
|
||||
@ -156,8 +156,8 @@ static inline void libopenjpeg_copyto16(AVFrame *picture, opj_image_t *image) {
|
||||
int index, x, y;
|
||||
for(index = 0; index < image->numcomps; index++) {
|
||||
comp_data = image->comps[index].data;
|
||||
img_ptr = (uint16_t*) picture->data[index];
|
||||
for(y = 0; y < image->comps[index].h; y++) {
|
||||
img_ptr = (uint16_t*) (picture->data[index] + y * picture->linesize[index]);
|
||||
for(x = 0; x < image->comps[index].w; x++) {
|
||||
*img_ptr = *comp_data;
|
||||
img_ptr++;
|
||||
|
Loading…
Reference in New Issue
Block a user