Recherche avancée

Médias (91)

Autres articles (27)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

Sur d’autres sites (6065)

  • avcodec/dvdsub_parser : Fix length check for short packets

    30 septembre 2022, par Aidan MacDonald
    avcodec/dvdsub_parser : Fix length check for short packets
    

    The DVD subtitle parser handles two types of packets : "normal"
    packets with a 16-bit length, and HD-DVD packets that set the
    16-bit length to 0 and encode a 32-bit length in the next four
    bytes. This implies that HD-DVD packets are at least six bytes
    long, but the code didn't actually verify this.

    The faulty length check results in an out of bounds read for
    zero-length "normal" packets that occur in the input, which are
    only 2 bytes long, but get misinterpreted as an HD-DVD packet.
    When this happens the parser reads packet_len from beyond the
    end of the input buffer. The subtitle stream is not correctly
    decoded after this point due to the garbage packet_len.

    Fixing this is pretty simple : fix the length check so packets
    less than 6 bytes long will not be mistakenly parsed as HD-DVD
    packets.

    Signed-off-by : Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
    Signed-off-by : Anton Khirnov <anton@khirnov.net>

    • [DH] libavcodec/dvdsub_parser.c
  • avcodec/rv34 : Don't needlessly copy VLC length and symbol arrays

    22 octobre 2020, par Andreas Rheinhardt
    avcodec/rv34 : Don't needlessly copy VLC length and symbol arrays
    

    Most of the VLCs used by RealVideo 3 and 4 obey three simple rules :
    Shorter codes are on the left of the tree, for each length, the symbols
    are ascending from left to right and the symbols either form a
    permutation of 1..size or 0..(size - 1). For the latter case, one just
    needs to store the length of each symbol and create the codes according
    to the other rules ; no explicit code or symbol array must be stored.
    The former case is also treated in much the same way by artificially
    assigning a length of zero to the symbol 0 ; when a length of zero was
    encountered, the element was ignored except that the symbol counter was
    still incremented. If the length was nonzero, the symbol would be
    assigned via the symbol counter and the length copied over into a new
    array.

    Yet this is unnecessary, as ff_init_vlc_sparse() follows exactly the
    same pattern : If a length of zero is encountered, the element is ignored
    and only the symbol counter incremented. So one can directly forward the
    length array and also need not create a symbol table oneself, because
    ff_init_vlc_sparse() will infer the same symbol table in this case.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavcodec/rv34.c
  • Memory leaks when opening RTMP stream with wrong url

    3 novembre 2015, par n00bie

    I’m using libav for streaming to YouTube through RTMP. I have function openRtmpStream() for opening RTMP stream. It works well. But recently i noticed the situation, when RTMP url is wrong (or server is down). In this situation my code is trying to reconnect, and calls this function about 15 times per second. With htop i can see about 20 MB per second memory leak in this situation.

    Maybe my code for closing context and streams is wrong ? Or any another idea what I’m doing wrong ? Thanks in advance !

    Here’s my code :

    bool openRtmpStream( const std::string&amp; address )
    {
       if( ! m_httpContext ) {
           m_httpContext = avformat_alloc_context( );

           m_httpContext->oformat = av_guess_format( "flv", address.c_str( ), nullptr );
           if( m_httpContext->oformat ) {
               strcpy( m_httpContext->filename, address.c_str( ) );

               auto codecID = AV_CODEC_ID_H264;

               auto codec = avcodec_find_encoder( codecID );

               if( codec ) {
                   m_httpVideoStream = avformat_new_stream( m_httpContext, codec );

                   // ... here's initalization of m_httpVideoStream->codec ...

                   int res = avcodec_open2( codecContext, codec, nullptr );
                   if( res >= 0 ) {
                       auto codecID = AV_CODEC_ID_MP3;
                       auto codec = avcodec_find_encoder( codecID );
                       if( codec ) {
                           m_httpAudioStream = avformat_new_stream( m_httpContext, codec );

                           // ... here's initalization of m_httpAudioStream->codec ...

                           res = avcodec_open2( codecContext, codec, nullptr );
                           if( res >= 0 ) {
                               m_httpStreamWriteStartTime = boost::chrono::high_resolution_clock::now( );
                               if( avio_open2( &amp;m_httpContext->pb, m_httpContext->filename, AVIO_FLAG_WRITE, m_AVIOInterruptCB.get( ), nullptr ) >= 0 ) {
                                   if( avformat_write_header( m_httpContext, nullptr ) >= 0 ) {
                                       return true; // success
                                   }
                               }
                               avcodec_close( m_httpAudioStream->codec );
                           }
                       }
                       avcodec_close( m_httpVideoStream->codec );
                   }
               }
           }

           // failed to open stream, close context and streams

           avio_close( m_httpContext->pb );
           avformat_free_context( m_httpContext );
           m_httpContext = nullptr;
           m_httpVideoStream = nullptr;
           m_httpAudioStream = nullptr;
       }
       return false;
    }