[FFmpeg-trac] #7993(undetermined:new): null pointer passed as argument at libavformat/aviobuf.c:227

FFmpeg trac at avcodec.org
Thu Jul 4 10:14:59 EEST 2019


#7993: null pointer passed as argument at libavformat/aviobuf.c:227
-------------------------------------+-------------------------------------
             Reporter:  Suhwan       |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  git-master   |               Resolution:
             Keywords:  ubsan        |               Blocked By:
  avformat                           |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Comment (by Suhwan):

 libavformat/aviobuf.c
 maybe buf pointer is null.
 {{{memcpy(s->buf_ptr, buf, len);}}}

 {{{
  218 void avio_write(AVIOContext *s, const unsigned char *buf, int size)
  219 {
  220     if (s->direct && !s->update_checksum) {
  221         avio_flush(s);
  222         writeout(s, buf, size);
  223         return;
  224     }
  225     while (size > 0) {
  226         int len = FFMIN(s->buf_end - s->buf_ptr, size);
  227         memcpy(s->buf_ptr, buf, len);
  228         s->buf_ptr += len;
  229
  230         if (s->buf_ptr >= s->buf_end)
  231             flush_buffer(s);
  232
  233         buf += len;
  234         size -= len;
  235     }
  236 }

 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7993#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list