[FFmpeg-trac] #8549(ffplay:reopened): A memory leak in ffplay

FFmpeg trac at avcodec.org
Wed Mar 11 10:04:27 EET 2020


#8549: A memory leak in ffplay
-------------------------------------+------------------------------------
             Reporter:  elite_jwp    |                    Owner:  cus
                 Type:  defect       |                   Status:  reopened
             Priority:  normal       |                Component:  ffplay
              Version:  unspecified  |               Resolution:
             Keywords:  leak         |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+------------------------------------
Changes (by elite_jwp):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 The fixed code still exists a issue:
 When using "av_packet_unref" to release memeory, it doesn't take the
 "flush_pkt" as a exception.

 Based on the new fixed code, here gives a patch:


 {{{
          do {
             if (d->queue->nb_packets == 0)
                  SDL_CondSignal(d->empty_queue_cond);
             if (d->packet_pending) {
                  av_packet_move_ref(&pkt, &d->pkt);
                  d->packet_pending = 0;
              } else {
                  if (packet_queue_get(d->queue, &pkt, 1, &d->pkt_serial) <
 0)
                     return -1;
              }
              if (d->queue->serial == d->pkt_serial)
                 break;
              '''if(pkt->data != flush_pkt.data)'''
                 av_packet_unref(&pkt);
          } while (1);
 }}}

 Is it ok?

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


More information about the FFmpeg-trac mailing list