Recherche avancée

Médias (91)

Autres articles (64)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (10668)

  • matroska : Fix use after free

    10 janvier 2013, par Dale Curtis

    matroska : Fix use after free

  • matroska : Fix use after free

    10 janvier 2013, par Dale Curtis

    matroska : Fix use after free

  • FFMPEG : Can not free AVPacket when decode H264 stream ?

    13 janvier 2016, par TTGroup

    I’m using FFMPEG to decode H264 stream, my code is below

    AVFormatContext *pFormatCtx = NULL;
    AVCodecContext  *pCodecCtx = NULL;
    AVFrame         *pFrame = NULL;
    AVPacket        packet;
    packet.data = NULL;

    pFormatCtx = avformat_alloc_context();  
    avformat_open_input(&pFormatCtx, videoStreamPath, NULL, NULL);
    liveHeader.pCodecCtx = pFormatCtx->streams[videoStreamIndex]->codec;

    int  bytesDecoded = 0;
    int  frameFinished = 0;
    while (true)
    {
       while (packet.size > 0)
       {
           // Decode the next chunk of data
           bytesDecoded = avcodec_decode_video2(pCodecCtx, pFrame,
               &frameFinished, &packet);

           // Was there an error?
           if (bytesDecoded < 0)
           {
               printf(strErr, "Error while decoding frame\n");
               commonGlobal->WriteRuntimeRecLogs(strErr);
               return RS_NOT_OK;
           }

           packet.size -= bytesDecoded;
           packet.data += bytesDecoded;
           if (frameFinished)
           {              
               //av_free_packet(&packet); //(free 1)
               return RS_OK;
           }
           // Did we finish the current frame? Then we can return
       }
       do
       {
           try
           {
               int ret = av_read_frame(pFormatCtx, &packet);
               if (ret < 0)
               {
                   char strErr[STR_LENGTH_256];
                   if (ret == AVERROR_EOF || (pFormatCtx->pb && pFormatCtx->pb->eof_reached))
                   {
                       sprintf(strErr, "Error end of file line %d", __LINE__);
                   }
                   if (pFormatCtx->pb && pFormatCtx->pb->error)
                   {
                       sprintf(strErr, "Error end of file line %d", __LINE__);
                   }
                   packet.data = NULL;
                   return RS_NOT_OK;
               }
           }
           catch (...)
           {
               packet.data = NULL;
               return RS_NOT_OK;
           }
       } while (packet.stream_index != videoStreamIndex);
    }

    //av_free_packet(&packet); //(free 2)

    The problem is I don’t know how to free memory of packet correctly.

    I have tried to delete packet’s data by calling one of two places av_free_packet(&packet); (free 1) and av_free_packet(&packet); (free 2). And the result is the application was crashed with the message "Heap Corruption..."

    If I do not free the packet, the memory leak is occur.

    Note that the above code is successful when decode H264 stream, the main problem is memory leak and crashed when I try to free the packet

    Someone can show me the problems in my code.

    Many thanks,

    T&T