Opened 4 years ago

Closed 3 years ago

#9264 closed defect (fixed)

libavdevice/xv.c: 317: supplying not enough memory ?

Reported by: dcb Owned by:
Priority: normal Component: avdevice
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

libavdevice/xv.c: In function ‘write_picture’:
libavdevice/xv.c:317:5: warning: ‘av_image_copy’ accessing 32 bytes in a region of size 24 [-Wstringop-overflow=]
  317 |     av_image_copy(data, img->pitches, (const uint8_t **)input_data, linesize,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  318 |                   xv->image_format, img->width, img->height);
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavdevice/xv.c:317:5: note: referencing argument 1 of type ‘uint8_t **’ {aka ‘unsigned char **’}

but

    uint8_t *data[3] = {
        img->data + img->offsets[0],
        img->data + img->offsets[1],
        img->data + img->offsets[2]
    };

and

void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],

data has to be 4, not 3.

Change History (2)

comment:1 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavdevice
Description: modified (diff)
Version: unspecifiedgit-master

Please send your patch - made with git format-patch - to the FFmpeg development mailing list, patches and patch suggestions on this bug tracker are usually ignored.

comment:2 by mkver, 3 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.