Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed incorrect pointer dereferencing in AVCodecContext allocation and setup #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,9 @@ for (int i = 0; i < avfc->nb_streams; i++)
{
AVStream *avs = avfc->streams[i];
AVCodec *avc = avcodec_find_decoder(avs->codecpar->codec_id);
AVCodecContext *avcc = avcodec_alloc_context3(*avc);
avcodec_parameters_to_context(*avcc, avs->codecpar);
avcodec_open2(*avcc, *avc, NULL);
AVCodecContext *avcc = avcodec_alloc_context3(avc);
avcodec_parameters_to_context(avcc, avs->codecpar);
avcodec_open2(avcc, avc, NULL);
}
```

Expand Down
8 changes: 4 additions & 4 deletions README-es.md
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,9 @@ for (int i = 0; i < avfc->nb_streams; i++)
{
AVStream *avs = avfc->streams[i];
AVCodec *avc = avcodec_find_decoder(avs->codecpar->codec_id);
AVCodecContext *avcc = avcodec_alloc_context3(*avc);
avcodec_parameters_to_context(*avcc, avs->codecpar);
avcodec_open2(*avcc, *avc, NULL);
AVCodecContext *avcc = avcodec_alloc_context3(avc);
avcodec_parameters_to_context(avcc, avs->codecpar);
avcodec_open2(avcc, avc, NULL);
}
```

Expand Down Expand Up @@ -961,4 +961,4 @@ Vamos a convertir el stream desde `h264` a `h265`, como se espera de la versión

```

> Ahora, para ser honesto, esto fue [más difícil de lo que pensé](https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/54), voy a tener que y ya me he metido dentro de [el código fuente de la linea de comandos FFmpeg](https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/54#issuecomment-570746749) y probarlo bastante, y también pienso que estoy olvidando algo, ya que cuando tengo que forzar `force-cfr` para que el `h264` funcione, me sigue arrojando algunos mensajes como `warning messages (forced frame type (5) at 80 was changed to frame type (3))`.
> Ahora, para ser honesto, esto fue [más difícil de lo que pensé](https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/54), voy a tener que y ya me he metido dentro de [el código fuente de la linea de comandos FFmpeg](https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/54#issuecomment-570746749) y probarlo bastante, y también pienso que estoy olvidando algo, ya que cuando tengo que forzar `force-cfr` para que el `h264` funcione, me sigue arrojando algunos mensajes como `warning messages (forced frame type (5) at 80 was changed to frame type (3))`.
6 changes: 3 additions & 3 deletions README-ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,9 @@ for (int i = 0; i < avfc->nb_streams; i++)
{
AVStream *avs = avfc->streams[i];
AVCodec *avc = avcodec_find_decoder(avs->codecpar->codec_id);
AVCodecContext *avcc = avcodec_alloc_context3(*avc);
avcodec_parameters_to_context(*avcc, avs->codecpar);
avcodec_open2(*avcc, *avc, NULL);
AVCodecContext *avcc = avcodec_alloc_context3(avc);
avcodec_parameters_to_context(avcc, avs->codecpar);
avcodec_open2(avcc, avc, NULL);
}
```

Expand Down
8 changes: 4 additions & 4 deletions README-pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,9 @@ for (int i = 0; i < avfc->nb_streams; i++)
{
AVStream *avs = avfc->streams[i];
AVCodec *avc = avcodec_find_decoder(avs->codecpar->codec_id);
AVCodecContext *avcc = avcodec_alloc_context3(*avc);
avcodec_parameters_to_context(*avcc, avs->codecpar);
avcodec_open2(*avcc, *avc, NULL);
AVCodecContext *avcc = avcodec_alloc_context3(avc);
avcodec_parameters_to_context(avcc, avs->codecpar);
avcodec_open2(avcc, avc, NULL);
}
```

Expand Down Expand Up @@ -954,4 +954,4 @@ Nós convertemos o fluxo de mídia de `h264` para `h265`, como esperado a versã

```

> Para ser honesto, isso foi mais difícil do que eu pensava que seria (https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/54) e tive que mergulhar no código-fonte da linha de comando do FFmpeg (https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/54#issuecomment-570746749) e testar muito, e acho que ainda estou perdendo alguma coisa, pois tive que forçar `force-cfr` para o `h264` funcionar e ainda estou vendo algumas mensagens de aviso, como `warning messages (forced frame type (5) at 80 was changed to frame type (3))`.
> Para ser honesto, isso foi mais difícil do que eu pensava que seria (https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/54) e tive que mergulhar no código-fonte da linha de comando do FFmpeg (https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/54#issuecomment-570746749) e testar muito, e acho que ainda estou perdendo alguma coisa, pois tive que forçar `force-cfr` para o `h264` funcionar e ainda estou vendo algumas mensagens de aviso, como `warning messages (forced frame type (5) at 80 was changed to frame type (3))`.
6 changes: 3 additions & 3 deletions README-vn.md
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,9 @@ for (int i = 0; i < avfc->nb_streams; i++)
{
AVStream *avs = avfc->streams[i];
AVCodec *avc = avcodec_find_decoder(avs->codecpar->codec_id);
AVCodecContext *avcc = avcodec_alloc_context3(*avc);
avcodec_parameters_to_context(*avcc, avs->codecpar);
avcodec_open2(*avcc, *avc, NULL);
AVCodecContext *avcc = avcodec_alloc_context3(avc);
avcodec_parameters_to_context(avcc, avs->codecpar);
avcodec_open2(avcc, avc, NULL);
}
```

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,9 @@ for (int i = 0; i < avfc->nb_streams; i++)
{
AVStream *avs = avfc->streams[i];
AVCodec *avc = avcodec_find_decoder(avs->codecpar->codec_id);
AVCodecContext *avcc = avcodec_alloc_context3(*avc);
avcodec_parameters_to_context(*avcc, avs->codecpar);
avcodec_open2(*avcc, *avc, NULL);
AVCodecContext *avcc = avcodec_alloc_context3(avc);
avcodec_parameters_to_context(avcc, avs->codecpar);
avcodec_open2(avcc, avc, NULL);
}
```

Expand Down