[FFmpeg-trac] #9264(avdevice:new): libavdevice/xv.c: 317: supplying not enough memory ?

FFmpeg trac at avcodec.org
Wed May 26 22:02:46 EEST 2021


#9264: libavdevice/xv.c: 317: supplying not enough memory ?
------------------------------------+------------------------------------
             Reporter:  dcb         |                    Owner:  (none)
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avdevice
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+------------------------------------
Changes (by Carl Eugen Hoyos):

 * version:  unspecified => git-master
 * component:  undetermined => avdevice


Old description:

> 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.

New description:

 {{{
 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.

--
Comment:

 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.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9264#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list